π Fixing pydantic related loading issue with Qwen2_5 class
Browse files
src/utils/qwen_inference.py
CHANGED
@@ -18,6 +18,12 @@ class Qwen2_5(BaseModel):
|
|
18 |
self.tokenizer = AutoTokenizer.from_pretrained(model_path)
|
19 |
self.processor = AutoProcessor.from_pretrained(model_path)
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
def prepare_single_inference(self, image: str, question: str):
|
22 |
image = f"data:image;base64,{image}"
|
23 |
messages = [
|
|
|
18 |
self.tokenizer = AutoTokenizer.from_pretrained(model_path)
|
19 |
self.processor = AutoProcessor.from_pretrained(model_path)
|
20 |
|
21 |
+
model_config = {
|
22 |
+
"arbitrary_types_allowed": True,
|
23 |
+
"from_attributes": True
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
def prepare_single_inference(self, image: str, question: str):
|
28 |
image = f"data:image;base64,{image}"
|
29 |
messages = [
|