Handle `UnicodeDecodeError` (#13717)

This commit is contained in:
Li-Huai (Allan) Lin 2021-09-24 04:56:34 +08:00 committed by GitHub
parent 8632a60d33
commit 1988849bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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. "