Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
fed02a49
Unverified
Commit
fed02a49
authored
Oct 30, 2025
by
FlyPanda
Committed by
GitHub
Oct 29, 2025
Browse files
[bugfix] fix deepseekvl2 and deepseek_ocr model type conflict (#12050)
Co-authored-by:
herta
<
herta@pplabs.org
>
parent
03b3e89a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
python/sglang/srt/utils/hf_transformers_utils.py
python/sglang/srt/utils/hf_transformers_utils.py
+9
-9
No files found.
python/sglang/srt/utils/hf_transformers_utils.py
View file @
fed02a49
...
...
@@ -197,14 +197,6 @@ def get_config(
config
=
AutoConfig
.
from_pretrained
(
model
,
trust_remote_code
=
trust_remote_code
,
revision
=
revision
,
**
kwargs
)
if
(
getattr
(
config
,
"auto_map"
,
None
)
is
not
None
and
config
.
auto_map
.
get
(
"AutoModel"
)
==
"modeling_deepseekocr.DeepseekOCRForCausalLM"
):
config
.
model_type
=
"deepseek-ocr"
# TODO: Remove this workaround when AutoConfig correctly identifies deepseek-ocr.
# Hugging Face's AutoConfig currently misidentifies it as deepseekvl2.
except
ValueError
as
e
:
if
not
"deepseek_v32"
in
str
(
e
):
...
...
@@ -241,7 +233,15 @@ def get_config(
setattr
(
config
,
key
,
val
)
if
config
.
model_type
in
_CONFIG_REGISTRY
:
config_class
=
_CONFIG_REGISTRY
[
config
.
model_type
]
model_type
=
config
.
model_type
if
model_type
==
"deepseek_vl_v2"
:
if
(
getattr
(
config
,
"auto_map"
,
None
)
is
not
None
and
config
.
auto_map
.
get
(
"AutoModel"
)
==
"modeling_deepseekocr.DeepseekOCRForCausalLM"
):
model_type
=
"deepseek-ocr"
config_class
=
_CONFIG_REGISTRY
[
model_type
]
config
=
config_class
.
from_pretrained
(
model
,
revision
=
revision
)
# NOTE(HandH1998): Qwen2VL requires `_name_or_path` attribute in `config`.
setattr
(
config
,
"_name_or_path"
,
model
)
...
...
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