Commit 7ba3130c authored by Patrick von Platen's avatar Patrick von Platen
Browse files

upload & fix

parent 2fa1d648
...@@ -209,21 +209,24 @@ def get_cached_module_file( ...@@ -209,21 +209,24 @@ def get_cached_module_file(
module_file_or_url = os.path.join(pretrained_model_name_or_path, module_file) module_file_or_url = os.path.join(pretrained_model_name_or_path, module_file)
submodule = "local" submodule = "local"
try: if os.path.isfile(module_file_or_url):
# Load from URL or cache if already cached resolved_module_file = module_file_or_url
resolved_module_file = cached_download( else:
module_file_or_url, try:
cache_dir=cache_dir, # Load from URL or cache if already cached
force_download=force_download, resolved_module_file = cached_download(
proxies=proxies, module_file_or_url,
resume_download=resume_download, cache_dir=cache_dir,
local_files_only=local_files_only, force_download=force_download,
use_auth_token=use_auth_token, proxies=proxies,
) resume_download=resume_download,
local_files_only=local_files_only,
except EnvironmentError: use_auth_token=use_auth_token,
logger.error(f"Could not locate the {module_file} inside {pretrained_model_name_or_path}.") )
raise
except EnvironmentError:
logger.error(f"Could not locate the {module_file} inside {pretrained_model_name_or_path}.")
raise
# Check we have all the requirements in our environment # Check we have all the requirements in our environment
modules_needed = check_imports(resolved_module_file) modules_needed = check_imports(resolved_module_file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment