Skip to content

Commit 01c03bf

Browse files
authored
fix: Catch correct ConnectionError for additional_chat_templates (#39874)
* fix: Catch correct ConnectionError for additional_chat_templates * fix: don't catch timeout * fix: formatting
1 parent 2bcf9f6 commit 01c03bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/utils/hub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def list_repo_templates(
176176
]
177177
except (GatedRepoError, RepositoryNotFoundError, RevisionNotFoundError):
178178
raise # valid errors => do not catch
179-
except (ConnectionError, HTTPError):
179+
except (HTTPError, requests.exceptions.ConnectionError):
180180
pass # offline mode, internet down, etc. => try local files
181181

182182
# check local files

0 commit comments

Comments
 (0)