2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

背景

ragas で evaluate() してたら Timeout が出てどうにもならなかったのでその調査の為に、log 出力方法を調べた記録

で debug log 出力方法

  • 環境変数で RAGAS_DEBUGTrue
  • log_tenacityTrue

実際のコードはこんな感じ

logging
import logging

from ragas import (
    evaluate,
    EvaluationDataset,
    RunConfig,
)

os.environ["RAGAS_DEBUG"] = str(True)  # ★ココ
logging.basicConfig(filename='debug.log', level=logging.DEBUG)

run_config = RunConfig(timeout=180, log_tenacity=True) # ★ココ
results = evaluate(dataset=eval_dataset, metrics=metrics, run_config=run_config)

以下で紹介されてました。

コード上は、以下

出力例

INFO:azure.identity._internal.decorators:AzureCliCredential.get_token_info succeeded
DEBUG:azure.identity._internal.decorators:Failed to log the account information: 'utf-8' codec can't decode bytes in position 496-497: invalid continuation byte
Traceback (most recent call last):
  File           

あとがき

ragas で動作がおかしい時に log で調査出来るのは大切ですよね :laughing:

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?