Skip to content

Commit 1677a09

Browse files
heheda12345Alvant
authored andcommitted
[Bugfix] Deprecate registration of custom configs to huggingface (vllm-project#9083)
Signed-off-by: Alvant <[email protected]>
1 parent 74c8360 commit 1677a09

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

tests/models/decoder_only/vision_language/test_internvl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def __init__(self, hf_runner: HfRunner):
9797
self.tokenizer = hf_runner.tokenizer
9898
self.dtype = hf_runner.model.dtype
9999

100-
self.config = AutoConfig.from_pretrained(hf_runner.model_name)
100+
self.config = AutoConfig.from_pretrained(hf_runner.model_name,
101+
trust_remote_code=True)
101102
self.vision_config = self.config.vision_config
102103
self.use_thumbnail = self.config.use_thumbnail
103104
self.min_num = self.config.min_dynamic_patch

tests/models/encoder_decoder/vision_language/test_mllama.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ def _run_test(
195195
def process(hf_inputs: BatchEncoding):
196196
return hf_inputs
197197

198-
from transformers.models.mllama import MllamaConfig as MllamaConfigHf
199-
200-
# use transformer's MllamaConfig for hf_runner
201-
# and vllm's MllamaConfig for vllm_runner
202-
AutoConfig.register("mllama", MllamaConfigHf, exist_ok=True)
203198
with hf_runner(model,
204199
dtype=dtype,
205200
model_kwargs={"device_map": "auto"},
@@ -213,8 +208,6 @@ def process(hf_inputs: BatchEncoding):
213208
for prompts, images in inputs
214209
]
215210

216-
from vllm.transformers_utils.configs.mllama import MllamaConfig
217-
AutoConfig.register("mllama", MllamaConfig, exist_ok=True)
218211
for hf_outputs, vllm_outputs in zip(hf_outputs_per_image,
219212
vllm_outputs_per_image):
220213
check_logprobs_close(

vllm/transformers_utils/config.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import contextlib
21
import enum
32
import json
43
from pathlib import Path
@@ -61,13 +60,6 @@
6160
**_CONFIG_REGISTRY_OVERRIDE_HF
6261
}
6362

64-
for name, cls in _CONFIG_REGISTRY.items():
65-
with contextlib.suppress(ValueError):
66-
if name in _CONFIG_REGISTRY_OVERRIDE_HF:
67-
AutoConfig.register(name, cls, exist_ok=True)
68-
else:
69-
AutoConfig.register(name, cls)
70-
7163

7264
class ConfigFormat(str, enum.Enum):
7365
AUTO = "auto"

0 commit comments

Comments
 (0)