Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix multi-modual bug (#1127)

KevinHuShe05395d2a79b
diff --git a/rag/llm/cv_model.py b/rag/llm/cv_model.py
index 010883a82c..a195fa2e53 100644
--- a/rag/llm/cv_model.py
+++ b/rag/llm/cv_model.py
@@ -75,10 +75,14 @@ class GptV4(Base):
def describe(self, image, max_tokens=300):
b64 = self.image2base64(image)
+ prompt = self.prompt(b64)
+ for i in range(len(prompt)):
+ for c in prompt[i]["content"]:
+ if "type" in c: del c["type"]
res = self.client.chat.completions.create(
model=self.model_name,
- messages=self.prompt(b64),
+ messages=prompt,
max_tokens=max_tokens,
)
return res.choices[0].message.content.strip(), res.usage.total_tokens