Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -160,17 +160,17 @@ You are a friendly medical chatbot designed to assist users by providing accurat
|
|
| 160 |
QA_PROMPT = PromptTemplate(QA_PROMPT_TMPL)
|
| 161 |
gpt_4o_mm = OpenAIMultiModal(model="gpt-4o-mini-2024-07-18")
|
| 162 |
|
| 163 |
-
class MultimodalQueryEngine(CustomQueryEngine):
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
|
| 175 |
|
| 176 |
class MultimodalQueryEngine(CustomQueryEngine):
|
|
|
|
| 160 |
QA_PROMPT = PromptTemplate(QA_PROMPT_TMPL)
|
| 161 |
gpt_4o_mm = OpenAIMultiModal(model="gpt-4o-mini-2024-07-18")
|
| 162 |
|
| 163 |
+
# class MultimodalQueryEngine(CustomQueryEngine):
|
| 164 |
+
# # def __init__(self, qa_prompt, retriever, multi_modal_llm, node_postprocessors=[]):
|
| 165 |
+
# # super().__init__(qa_prompt=qa_prompt, retriever=retriever, multi_modal_llm=multi_modal_llm, node_postprocessors=node_postprocessors)
|
| 166 |
+
|
| 167 |
+
# # def custom_query(self, query_str):
|
| 168 |
+
# # nodes = self.retriever.retrieve(query_str)
|
| 169 |
+
# # image_nodes = [NodeWithScore(node=ImageNode(image_path=n.node.metadata["image_path"])) for n in nodes]
|
| 170 |
+
# # ctx_str = "\n\n".join([r.node.get_content().strip() for r in nodes])
|
| 171 |
+
# # fmt_prompt = self.qa_prompt.format(context_str=ctx_str, query_str=query_str, encoded_image_url=encoded_image_url)
|
| 172 |
+
# # llm_response = self.multi_modal_llm.complete(prompt=fmt_prompt, image_documents=[image_node.node for image_node in image_nodes])
|
| 173 |
+
# # return Response(response=str(llm_response), source_nodes=nodes, metadata={"text_nodes": text_nodes, "image_nodes": image_nodes})
|
| 174 |
|
| 175 |
|
| 176 |
class MultimodalQueryEngine(CustomQueryEngine):
|