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
fc37187a
Unverified
Commit
fc37187a
authored
Jan 23, 2026
by
Xu Jinyang
Committed by
GitHub
Jan 22, 2026
Browse files
[Bugfix] ModelScope is supported when downloading LORA models. (#32844)
Signed-off-by:
AuYang
<
459461160@qq.com
>
parent
ff365eea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
vllm/lora/utils.py
vllm/lora/utils.py
+21
-6
No files found.
vllm/lora/utils.py
View file @
fc37187a
...
@@ -9,6 +9,7 @@ from huggingface_hub.utils import HfHubHTTPError, HFValidationError
...
@@ -9,6 +9,7 @@ from huggingface_hub.utils import HfHubHTTPError, HFValidationError
from
torch
import
nn
from
torch
import
nn
from
transformers
import
PretrainedConfig
from
transformers
import
PretrainedConfig
from
vllm
import
envs
from
vllm.config.lora
import
LoRAConfig
from
vllm.config.lora
import
LoRAConfig
from
vllm.logger
import
init_logger
from
vllm.logger
import
init_logger
...
@@ -235,13 +236,27 @@ def get_adapter_absolute_path(lora_path: str) -> str:
...
@@ -235,13 +236,27 @@ def get_adapter_absolute_path(lora_path: str) -> str:
if
os
.
path
.
exists
(
lora_path
):
if
os
.
path
.
exists
(
lora_path
):
return
os
.
path
.
abspath
(
lora_path
)
return
os
.
path
.
abspath
(
lora_path
)
# If the path does not exist locally, assume it's a Hugging Face repo.
# If the path does not exist locally.
if
envs
.
VLLM_USE_MODELSCOPE
:
# If using ModelScope, we assume the path is a ModelScope repo.
from
modelscope.hub.snapshot_download
import
InvalidParameter
,
snapshot_download
from
requests
import
HTTPError
download_fn
=
lambda
:
snapshot_download
(
model_id
=
lora_path
)
download_exceptions
=
(
HTTPError
,
InvalidParameter
)
error_log
=
"Error downloading the ModelScope model"
else
:
# Otherwise, we assume the path is a Hugging Face Hub repo.
download_fn
=
lambda
:
huggingface_hub
.
snapshot_download
(
repo_id
=
lora_path
)
download_exceptions
=
(
HfHubHTTPError
,
HFValidationError
)
error_log
=
"Error downloading the HuggingFace model"
try
:
try
:
local_snapshot_path
=
huggingface_hub
.
snapshot_download
(
repo_id
=
lora_path
)
local_snapshot_path
=
download_fn
(
)
except
(
HfHubHTTPError
,
HFValidationError
)
:
except
download_exceptions
:
# Handle errors that may occur during the download
# Handle errors that may occur during the download
.
# Return original path instead of throwing error here
# Return original path instead of throwing error here
.
logger
.
exception
(
"E
rror
downloading the HuggingFace model"
)
logger
.
exception
(
e
rror
_log
)
return
lora_path
return
lora_path
return
local_snapshot_path
return
local_snapshot_path
...
...
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