[Misc] Add network timeout to eval dataset downloads (#21873)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Liangsheng Yin
2026-04-01 13:16:14 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent a19ef3a615
commit 0138708576
6 changed files with 18 additions and 6 deletions
+1 -1
View File
@@ -519,7 +519,7 @@ def make_report_from_example_htmls(htmls: List[str]):
def download_dataset(path, url):
print(f"Downloading dataset {path} from {url}")
try:
response = requests.get(url, stream=True, timeout=120)
response = requests.get(url, stream=True, timeout=30)
response.raise_for_status()
total_size = int(response.headers.get("content-length", 0))
+4 -1
View File
@@ -32,7 +32,10 @@ class GPQAEval(Eval):
num_threads: int,
n_repeats: int = 1,
):
df = pandas.read_csv(filename)
if "://" in filename:
df = pandas.read_csv(filename, storage_options={"timeout": 30})
else:
df = pandas.read_csv(filename)
examples = [row.to_dict() for _, row in df.iterrows()]
rng = random.Random(0)
if num_examples:
+4 -1
View File
@@ -40,7 +40,10 @@ class MathEval(Eval):
num_examples: Optional[int],
num_threads: int,
):
df = pandas.read_csv(filename)
if "://" in filename:
df = pandas.read_csv(filename, storage_options={"timeout": 30})
else:
df = pandas.read_csv(filename)
examples = [row.to_dict() for _, row in df.iterrows()]
if num_examples:
examples = random.Random(0).sample(examples, num_examples)
+4 -1
View File
@@ -86,7 +86,10 @@ subject2category = {
class MMLUEval(Eval):
def __init__(self, filename: str, num_examples: Optional[int], num_threads: int):
df = pandas.read_csv(filename)
if "://" in filename:
df = pandas.read_csv(filename, storage_options={"timeout": 30})
else:
df = pandas.read_csv(filename)
examples = [row.to_dict() for _, row in df.iterrows()]
if num_examples:
examples = random.Random(0).sample(examples, num_examples)