Skip to content

fix: pass download_config to LocalEvaluationModuleFactory calls#770

Open
aadhar-build wants to merge 1 commit into
huggingface:mainfrom
aadhar-build:fix/issue-709-download-config-local-factory
Open

fix: pass download_config to LocalEvaluationModuleFactory calls#770
aadhar-build wants to merge 1 commit into
huggingface:mainfrom
aadhar-build:fix/issue-709-download-config-local-factory

Conversation

@aadhar-build

Copy link
Copy Markdown

Summary

Fixes #709.

Two call sites in evaluation_module_factory() that instantiate LocalEvaluationModuleFactory omit the download_config parameter:

# Before (both calls):
return LocalEvaluationModuleFactory(
    path, download_mode=download_mode, dynamic_modules_path=dynamic_modules_path
).get_module()

This means any custom DownloadConfig passed by the caller (e.g. custom token, proxies, retries, or cache settings) is silently dropped when loading local metric scripts. The same config is correctly forwarded when loading from the Hub via HubEvaluationModuleFactory.

Fix

Add download_config=download_config to both LocalEvaluationModuleFactory instantiations, matching the pattern already used for HubEvaluationModuleFactory:

# After:
return LocalEvaluationModuleFactory(
    path, download_config=download_config, download_mode=download_mode, dynamic_modules_path=dynamic_modules_path
).get_module()

This ensures that callers who pass a DownloadConfig (e.g. with use_auth_token, proxies, or custom user_agent) have that config respected even when the metric is loaded from a local path.

Fixes huggingface#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DownloadConfig is not passed to LocalEvaluationModuleFactory when loading from local file, causing uncontrollable download behavior

1 participant