fix compatibility issue for transformers 4.46+
Browse files
configuration_internvl_chat.py
CHANGED
@@ -46,10 +46,10 @@ class InternVLChatConfig(PretrainedConfig):
|
|
46 |
logger.info('llm_config is None. Initializing the LlamaConfig config with default values (`LlamaConfig`).')
|
47 |
|
48 |
self.vision_config = InternVisionConfig(**vision_config)
|
49 |
-
if llm_config.get(
|
50 |
self.llm_config = LlamaConfig(**llm_config)
|
51 |
else:
|
52 |
-
raise ValueError('Unsupported architecture: {}'.format(llm_config.get(
|
53 |
self.use_backbone_lora = use_backbone_lora
|
54 |
self.use_llm_lora = use_llm_lora
|
55 |
self.select_layer = select_layer
|
|
|
46 |
logger.info('llm_config is None. Initializing the LlamaConfig config with default values (`LlamaConfig`).')
|
47 |
|
48 |
self.vision_config = InternVisionConfig(**vision_config)
|
49 |
+
if llm_config.get('architectures')[0] == 'LlamaForCausalLM':
|
50 |
self.llm_config = LlamaConfig(**llm_config)
|
51 |
else:
|
52 |
+
raise ValueError('Unsupported architecture: {}'.format(llm_config.get('architectures')[0]))
|
53 |
self.use_backbone_lora = use_backbone_lora
|
54 |
self.use_llm_lora = use_llm_lora
|
55 |
self.select_layer = select_layer
|