mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 02:31:11 +06:00
Handle UnicodeDecodeError
(#13717)
This commit is contained in:
parent
8632a60d33
commit
1988849bbf
@ -569,7 +569,7 @@ class PretrainedConfig(PushToHubMixin):
|
||||
|
||||
raise EnvironmentError(msg)
|
||||
|
||||
except json.JSONDecodeError:
|
||||
except (json.JSONDecodeError, UnicodeDecodeError):
|
||||
msg = (
|
||||
f"Couldn't reach server at '{config_file}' to download configuration file or "
|
||||
"configuration file is not a valid JSON file. "
|
||||
|
Loading…
Reference in New Issue
Block a user