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
cfadb9c6
Unverified
Commit
cfadb9c6
authored
Oct 05, 2024
by
Chen Zhang
Committed by
GitHub
Oct 05, 2024
Browse files
[Bugfix] Deprecate registration of custom configs to huggingface (#9083)
parent
15986f59
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
16 deletions
+2
-16
tests/models/decoder_only/vision_language/test_internvl.py
tests/models/decoder_only/vision_language/test_internvl.py
+2
-1
tests/models/encoder_decoder/vision_language/test_mllama.py
tests/models/encoder_decoder/vision_language/test_mllama.py
+0
-7
vllm/transformers_utils/config.py
vllm/transformers_utils/config.py
+0
-8
No files found.
tests/models/decoder_only/vision_language/test_internvl.py
View file @
cfadb9c6
...
...
@@ -97,7 +97,8 @@ def run_test(
self
.
tokenizer
=
hf_runner
.
tokenizer
self
.
dtype
=
hf_runner
.
model
.
dtype
self
.
config
=
AutoConfig
.
from_pretrained
(
hf_runner
.
model_name
)
self
.
config
=
AutoConfig
.
from_pretrained
(
hf_runner
.
model_name
,
trust_remote_code
=
True
)
self
.
vision_config
=
self
.
config
.
vision_config
self
.
use_thumbnail
=
self
.
config
.
use_thumbnail
self
.
min_num
=
self
.
config
.
min_dynamic_patch
...
...
tests/models/encoder_decoder/vision_language/test_mllama.py
View file @
cfadb9c6
...
...
@@ -195,11 +195,6 @@ def _run_test(
def
process
(
hf_inputs
:
BatchEncoding
):
return
hf_inputs
from
transformers.models.mllama
import
MllamaConfig
as
MllamaConfigHf
# use transformer's MllamaConfig for hf_runner
# and vllm's MllamaConfig for vllm_runner
AutoConfig
.
register
(
"mllama"
,
MllamaConfigHf
,
exist_ok
=
True
)
with
hf_runner
(
model
,
dtype
=
dtype
,
model_kwargs
=
{
"device_map"
:
"auto"
},
...
...
@@ -213,8 +208,6 @@ def _run_test(
for
prompts
,
images
in
inputs
]
from
vllm.transformers_utils.configs.mllama
import
MllamaConfig
AutoConfig
.
register
(
"mllama"
,
MllamaConfig
,
exist_ok
=
True
)
for
hf_outputs
,
vllm_outputs
in
zip
(
hf_outputs_per_image
,
vllm_outputs_per_image
):
check_logprobs_close
(
...
...
vllm/transformers_utils/config.py
View file @
cfadb9c6
import
contextlib
import
enum
import
json
from
pathlib
import
Path
...
...
@@ -61,13 +60,6 @@ _CONFIG_REGISTRY: Dict[str, Type[PretrainedConfig]] = {
**
_CONFIG_REGISTRY_OVERRIDE_HF
}
for
name
,
cls
in
_CONFIG_REGISTRY
.
items
():
with
contextlib
.
suppress
(
ValueError
):
if
name
in
_CONFIG_REGISTRY_OVERRIDE_HF
:
AutoConfig
.
register
(
name
,
cls
,
exist_ok
=
True
)
else
:
AutoConfig
.
register
(
name
,
cls
)
class
ConfigFormat
(
str
,
enum
.
Enum
):
AUTO
=
"auto"
...
...
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