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
e568cf88
Unverified
Commit
e568cf88
authored
Mar 11, 2026
by
Isotr0py
Committed by
GitHub
Mar 11, 2026
Browse files
[UX] Infer dtype for local checkpoint (#36218)
Signed-off-by:
Isotr0py
<
mozf@mail2.sysu.edu.cn
>
parent
098d8447
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
vllm/transformers_utils/config.py
vllm/transformers_utils/config.py
+1
-1
vllm/transformers_utils/model_arch_config_convertor.py
vllm/transformers_utils/model_arch_config_convertor.py
+7
-7
No files found.
vllm/transformers_utils/config.py
View file @
e568cf88
...
...
@@ -1116,7 +1116,7 @@ def get_safetensors_params_metadata(
revision
:
str
|
None
=
None
,
)
->
dict
[
str
,
Any
]:
"""
Get the safetensors metadata for remote model repository.
Get the safetensors
parameters
metadata for remote
/local
model repository.
"""
full_metadata
=
{}
if
(
model_path
:
=
Path
(
model
)).
exists
():
...
...
vllm/transformers_utils/model_arch_config_convertor.py
View file @
e568cf88
...
...
@@ -18,7 +18,7 @@ from vllm.config.utils import getattr_iter
from
vllm.logger
import
init_logger
from
vllm.transformers_utils.config
import
(
ConfigFormat
,
try_
get_safetensors_metadata
,
get_safetensors_
params_
metadata
,
)
from
vllm.utils.torch_utils
import
common_broadcastable_dtype
...
...
@@ -165,14 +165,14 @@ class ModelArchConfigConvertorBase:
# Try to read the dtype of the weights if they are in safetensors format
if
config_dtype
is
None
:
with
_maybe_patch_hf_hub_constants
(
config_format
):
repo
_mt
=
try_
get_safetensors_metadata
(
model_id
,
revision
=
revision
)
param
_mt
=
get_safetensors_
params_
metadata
(
model_id
,
revision
=
revision
)
if
repo_mt
and
(
files_mt
:
=
repo_mt
.
files_metadata
)
:
if
param_mt
:
param_dtypes
:
set
[
torch
.
dtype
]
=
{
_SAFETENSORS_TO_TORCH_DTYPE
[
dtype
_str
]
for
file_mt
in
files
_mt
.
values
()
for
dtype
_str
in
file_mt
.
parameter_count
if
dtype
_str
in
_SAFETENSORS_TO_TORCH_DTYPE
_SAFETENSORS_TO_TORCH_DTYPE
[
dtype
]
for
info
in
param
_mt
.
values
()
if
(
dtype
:
=
info
.
get
(
"dtype"
,
None
))
and
dtype
in
_SAFETENSORS_TO_TORCH_DTYPE
}
if
param_dtypes
:
...
...
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