diff --git a/src/transformers/configuration_utils.py b/src/transformers/configuration_utils.py index bc3ecf77ba1..fd8786692ca 100755 --- a/src/transformers/configuration_utils.py +++ b/src/transformers/configuration_utils.py @@ -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. "