|
34 | 34 | KimiVLConfig, MedusaConfig,
|
35 | 35 | MLPSpeculatorConfig,
|
36 | 36 | Nemotron_Nano_VL_Config,
|
37 |
| - NemotronConfig, OvisConfig, |
38 |
| - RWConfig, SpeculatorsConfig, |
| 37 | + NemotronConfig, |
| 38 | + OvisConfig, RWConfig, |
| 39 | + SpeculatorsConfig, |
39 | 40 | Step3TextConfig, Step3VLConfig,
|
40 | 41 | UltravoxConfig)
|
41 | 42 |
|
42 |
| -try: |
43 |
| - from vllm.transformers_utils.configs.mllama import MllamaConfig |
44 |
| -except ImportError: |
45 |
| - MllamaConfig = None |
46 |
| - |
47 | 43 | # yapf: enable
|
48 | 44 | from vllm.transformers_utils.configs.mistral import adapt_config_dict
|
49 |
| -from vllm.transformers_utils.configs.nvlm_d import NVLM_D_Config |
50 | 45 | from vllm.transformers_utils.utils import check_gguf_file
|
51 | 46 |
|
52 | 47 | if envs.VLLM_USE_MODELSCOPE:
|
@@ -103,6 +98,20 @@ def _get_hf_token() -> Optional[str]:
|
103 | 98 | "llm_config": "text_config",
|
104 | 99 | }
|
105 | 100 |
|
| 101 | +_AUTO_CONFIG_KWARGS_OVERRIDES: dict[str, dict[str, Any]] = { |
| 102 | + "internvl_chat": { |
| 103 | + "has_no_defaults_at_init": True |
| 104 | + }, |
| 105 | + # transformers regards mllama as is_encoder_decoder=False |
| 106 | + # vllm needs is_encoder_decoder=True to enable cross-attention |
| 107 | + "mllama": { |
| 108 | + "is_encoder_decoder": True |
| 109 | + }, |
| 110 | + "NVLM_D": { |
| 111 | + "has_no_defaults_at_init": True |
| 112 | + }, |
| 113 | +} |
| 114 | + |
106 | 115 |
|
107 | 116 | class ConfigFormat(str, enum.Enum):
|
108 | 117 | AUTO = "auto"
|
@@ -924,22 +933,19 @@ def get_hf_file_bytes(file_name: str,
|
924 | 933 | file_path = try_get_local_file(model=model,
|
925 | 934 | file_name=file_name,
|
926 | 935 | revision=revision)
|
927 |
| - |
| 936 | + |
928 | 937 | if file_path is None:
|
929 | 938 | try:
|
930 |
| - hf_hub_file = hf_hub_download(model, |
931 |
| - file_name, |
932 |
| - revision=revision, |
933 |
| - token=_get_hf_token()) |
| 939 | + hf_hub_file = hf_hub_download(model, file_name, revision=revision, token=_get_hf_token()) |
934 | 940 | file_path = Path(hf_hub_file)
|
935 | 941 | except Exception:
|
936 | 942 | return None
|
937 |
| - |
| 943 | + |
938 | 944 | if file_path is not None and file_path.is_file():
|
939 | 945 | try:
|
940 | 946 | with open(file_path, 'rb') as file:
|
941 | 947 | return file.read()
|
942 | 948 | except Exception:
|
943 | 949 | return None
|
944 |
| - |
| 950 | + |
945 | 951 | return None
|
0 commit comments