From b5c840c9a461e523f2eed15e665771b325f42d9a Mon Sep 17 00:00:00 2001 From: Aadhar Agarwal Date: Mon, 29 Jun 2026 11:06:28 +0000 Subject: [PATCH] fix: pass download_config to LocalEvaluationModuleFactory calls Fixes #709: Two call sites in evaluation_module_factory() that instantiate LocalEvaluationModuleFactory omit the download_config parameter, so any custom download configuration (e.g. token, proxies, retries) passed by the caller is silently dropped for local metric scripts. Pass download_config=download_config to both calls, matching the existing behaviour of HubEvaluationModuleFactory. --- src/evaluate/loading.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evaluate/loading.py b/src/evaluate/loading.py index 505015b1..bcbbef08 100644 --- a/src/evaluate/loading.py +++ b/src/evaluate/loading.py @@ -617,13 +617,13 @@ def evaluation_module_factory( if path.endswith(filename): if os.path.isfile(path): return LocalEvaluationModuleFactory( - path, download_mode=download_mode, dynamic_modules_path=dynamic_modules_path + path, download_config=download_config, download_mode=download_mode, dynamic_modules_path=dynamic_modules_path ).get_module() else: raise FileNotFoundError(f"Couldn't find a metric script at {relative_to_absolute_path(path)}") elif os.path.isfile(combined_path): return LocalEvaluationModuleFactory( - combined_path, download_mode=download_mode, dynamic_modules_path=dynamic_modules_path + combined_path, download_config=download_config, download_mode=download_mode, dynamic_modules_path=dynamic_modules_path ).get_module() elif is_relative_path(path) and path.count("/") <= 1 and not force_local_path: try: