[Bug] Fix tmp directory for `lm_eval` (#47755)

Signed-off-by: yewentao256 <zhyanwentao@126.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

Wentao Ye committed Jul 7, 2026 at 12:40 UTC bdc6f3bfa10411dd6272d5394b0328bce86893e3
1 file changed +2 -1
tests/evals/gsm8k/gsm8k_eval.py
+2 -1
@@ -10,6 +10,7 @@ import ast
10 import asyncio
11 import json
12 import os
13 +import tempfile
14 import time
15 from collections.abc import Generator
16
@@ -25,7 +26,7 @@ INVALID = -9999999
26 def download_and_cache_file(url: str, filename: str | None = None) -> str:
27 """Download and cache a file from a URL."""
28 if filename is None:
28 - filename = os.path.join("/tmp", url.split("/")[-1])
29 + filename = os.path.join(tempfile.gettempdir(), url.split("/")[-1])
30
31 if os.path.exists(filename):
32 return filename