MCPcopy Create free account
hub / github.com/Alibaba-NLP/DeepResearch / call

Function call

WebAgent/WebWalker/src/evaluate.py:48–63  ·  view source on GitHub ↗

Handles evaluation retries with exponential backoff.

(data)

Source from the content-addressed store, hash-verified

46 data_list.append(data)
47
48 def call(data):
49 """Handles evaluation retries with exponential backoff."""
50 max_retries = 10
51 for attempt in range(max_retries):
52 try:
53 return evaluator.evaluate_strings(
54 prediction=data["pred"],
55 input=data["question"],
56 reference=data["answer"]
57 )
58 except Exception as e:
59 print(f"Error during evaluation: {e}")
60 if attempt < max_retries - 1:
61 time.sleep(1 * (2 ** attempt)) # Exponential backoff
62 else:
63 raise e # Raise the exception if the last retry fails
64
65 s = 0
66 cnt = 0

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected