[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>
This commit is contained in:
Wentao Ye
2026-07-07 16:40:12 +00:00
committed by GitHub
co-authored by mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 392d1b4d2e
commit bdc6f3bfa1
+2 -1
View File
@@ -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