From bdc6f3bfa10411dd6272d5394b0328bce86893e3 Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Tue, 7 Jul 2026 12:40:12 -0400 Subject: [PATCH] [Bug] Fix tmp directory for `lm_eval` (#47755) Signed-off-by: yewentao256 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- tests/evals/gsm8k/gsm8k_eval.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/evals/gsm8k/gsm8k_eval.py b/tests/evals/gsm8k/gsm8k_eval.py index 87235a9c37..45f2a13fdd 100644 --- a/tests/evals/gsm8k/gsm8k_eval.py +++ b/tests/evals/gsm8k/gsm8k_eval.py @@ -10,6 +10,7 @@ import ast import asyncio import json import os +import tempfile import time from collections.abc import Generator @@ -25,7 +26,7 @@ INVALID = -9999999 def download_and_cache_file(url: str, filename: str | None = None) -> str: """Download and cache a file from a URL.""" if filename is None: - filename = os.path.join("/tmp", url.split("/")[-1]) + filename = os.path.join(tempfile.gettempdir(), url.split("/")[-1]) if os.path.exists(filename): return filename