Sdm0 commited on
Commit
b7084eb
·
verified ·
1 Parent(s): f6e654d

perf: reduce RAGAS relevance latency

Browse files
Files changed (1) hide show
  1. eval_data/ragas_eval.py +2 -2
eval_data/ragas_eval.py CHANGED
@@ -67,7 +67,7 @@ def _check_ragas() -> bool:
67
  # limits so scoring completes instead of tripping 429s — which previously
68
  # caused long retry backoffs and 0.0000 scores. Override with the
69
  # OCR_RAGAS_INTERVAL env var (float seconds, 0 disables).
70
- _RAGAS_INTERVAL = float(os.environ.get("OCR_RAGAS_INTERVAL", "3.0") or 3.0)
71
  _ragas_throttle_lock = threading.Lock()
72
 
73
 
@@ -472,7 +472,7 @@ def _compute_mmr(
472
  # Score up to the first 5 chunks for relevance using the LLM.
473
  # Top-5 MMR is standard — rank 5 yields 1/5 = 0.20, and
474
  # anything beyond rank 5 barely changes the score anyway.
475
- MAX_MMR_RANK = 5
476
  top_chunks = retrieved_contexts[:MAX_MMR_RANK]
477
 
478
  judged = 0
 
67
  # limits so scoring completes instead of tripping 429s — which previously
68
  # caused long retry backoffs and 0.0000 scores. Override with the
69
  # OCR_RAGAS_INTERVAL env var (float seconds, 0 disables).
70
+ _RAGAS_INTERVAL = float(os.environ.get("OCR_RAGAS_INTERVAL", "0.5") or 0.5)
71
  _ragas_throttle_lock = threading.Lock()
72
 
73
 
 
472
  # Score up to the first 5 chunks for relevance using the LLM.
473
  # Top-5 MMR is standard — rank 5 yields 1/5 = 0.20, and
474
  # anything beyond rank 5 barely changes the score anyway.
475
+ MAX_MMR_RANK = 2
476
  top_chunks = retrieved_contexts[:MAX_MMR_RANK]
477
 
478
  judged = 0