From b109257f4fb8b1166e7c53cc5418632014ed53a5 Mon Sep 17 00:00:00 2001 From: ulatekh Date: Fri, 12 Apr 2024 10:03:49 -0700 Subject: [PATCH] Fixed config.json download to go to user-supplied cache directory (#30189) * Fixed config.json download to go to user-supplied cache directory. * Simplied implementation suggested by @amyeroberts --- src/transformers/pipelines/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transformers/pipelines/__init__.py b/src/transformers/pipelines/__init__.py index 8ee0137a20b3ff..e60035dd5732d6 100755 --- a/src/transformers/pipelines/__init__.py +++ b/src/transformers/pipelines/__init__.py @@ -782,6 +782,7 @@ def pipeline( _raise_exceptions_for_gated_repo=False, _raise_exceptions_for_missing_entries=False, _raise_exceptions_for_connection_errors=False, + cache_dir=model_kwargs.get("cache_dir"), **hub_kwargs, ) hub_kwargs["_commit_hash"] = extract_commit_hash(resolved_config_file, commit_hash)