[PaddleOCR-VL] Add BC for transformers 5.0 config (#33976)
Signed-off-by: zhangyue66 <zhangyue66@baidu.com>
This commit is contained in:
@@ -994,6 +994,13 @@ class PaddleOCRVLForConditionalGeneration(nn.Module, SupportsMultiModal, Support
|
||||
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
|
||||
super().__init__()
|
||||
config = vllm_config.model_config.hf_config
|
||||
if hasattr(config, "text_config"):
|
||||
text_config = config.text_config.to_dict()
|
||||
unsafe_keys = ["model_type", "architectures", "tie_word_embeddings"]
|
||||
for key in unsafe_keys:
|
||||
text_config.pop(key, None)
|
||||
config.update(text_config)
|
||||
|
||||
quant_config = vllm_config.quant_config
|
||||
|
||||
self.config = config
|
||||
|
||||
Reference in New Issue
Block a user