Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
7a8987da
Unverified
Commit
7a8987da
authored
Jan 31, 2025
by
Roger Wang
Committed by
GitHub
Jan 31, 2025
Browse files
[Bugfix] Gracefully handle huggingface hub http error (#12571)
parent
cabaf4ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
vllm/transformers_utils/config.py
vllm/transformers_utils/config.py
+9
-1
No files found.
vllm/transformers_utils/config.py
View file @
7a8987da
...
@@ -7,7 +7,8 @@ from typing import Any, Dict, Optional, Type, Union
...
@@ -7,7 +7,8 @@ from typing import Any, Dict, Optional, Type, Union
import
huggingface_hub
import
huggingface_hub
from
huggingface_hub
import
(
file_exists
,
hf_hub_download
,
from
huggingface_hub
import
(
file_exists
,
hf_hub_download
,
try_to_load_from_cache
)
try_to_load_from_cache
)
from
huggingface_hub.utils
import
(
EntryNotFoundError
,
LocalEntryNotFoundError
,
from
huggingface_hub.utils
import
(
EntryNotFoundError
,
HfHubHTTPError
,
LocalEntryNotFoundError
,
RepositoryNotFoundError
,
RepositoryNotFoundError
,
RevisionNotFoundError
)
RevisionNotFoundError
)
from
torch
import
nn
from
torch
import
nn
...
@@ -294,6 +295,13 @@ def get_hf_file_to_dict(file_name: str,
...
@@ -294,6 +295,13 @@ def get_hf_file_to_dict(file_name: str,
logger
.
debug
(
"File or repository not found in hf_hub_download"
,
logger
.
debug
(
"File or repository not found in hf_hub_download"
,
e
)
e
)
return
None
return
None
except
HfHubHTTPError
as
e
:
logger
.
warning
(
"Cannot connect to Hugging Face Hub. Skipping file "
"download for '%s':"
,
file_name
,
exc_info
=
e
)
return
None
file_path
=
Path
(
hf_hub_file
)
file_path
=
Path
(
hf_hub_file
)
with
open
(
file_path
)
as
file
:
with
open
(
file_path
)
as
file
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment