From 5b5f17af8e9a7465ceff533a561bd4fd0dd542c3 Mon Sep 17 00:00:00 2001 From: cgutierr Date: Sun, 3 Aug 2025 13:00:27 +0200 Subject: [PATCH] Use generic AutoModel not tied to specific arch --- libs/python/agent/agent/adapters/huggingfacelocal_adapter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py b/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py index f8706868..22286059 100644 --- a/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py +++ b/libs/python/agent/agent/adapters/huggingfacelocal_adapter.py @@ -8,7 +8,7 @@ from litellm import completion, acompletion # Try to import HuggingFace dependencies try: import torch - from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor + from transformers import AutoModelForImageTextToText, AutoProcessor HF_AVAILABLE = True except ImportError: HF_AVAILABLE = False @@ -40,7 +40,7 @@ class HuggingFaceLocalAdapter(CustomLLM): """ if model_name not in self.models: # Load model - model = Qwen2_5_VLForConditionalGeneration.from_pretrained( + model = AutoModelForImageTextToText.from_pretrained( model_name, torch_dtype=torch.float16, device_map=self.device,