Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -137,21 +137,20 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
137 |
#document_storage_chroma(splits)
|
138 |
db = document_retrieval_chroma(llm, prompt)
|
139 |
completion = rag_chain(llm, prompt, db)
|
140 |
-
|
141 |
elif (rag_option == "MongoDB"):
|
142 |
#splits = document_loading_splitting()
|
143 |
#document_storage_mongodb(splits)
|
144 |
db = document_retrieval_mongodb(llm, prompt)
|
145 |
completion = rag_chain(llm, prompt, db)
|
146 |
-
|
147 |
else:
|
148 |
-
|
149 |
-
completion = result
|
150 |
except Exception as e:
|
151 |
raise gr.Error(e)
|
152 |
finally:
|
153 |
wandb_log(prompt, completion, rag_option)
|
154 |
-
return
|
155 |
|
156 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|
157 |
<strong>retrieval augmented generation (RAG)</strong>.
|
|
|
137 |
#document_storage_chroma(splits)
|
138 |
db = document_retrieval_chroma(llm, prompt)
|
139 |
completion = rag_chain(llm, prompt, db)
|
140 |
+
completion = completion["result"]
|
141 |
elif (rag_option == "MongoDB"):
|
142 |
#splits = document_loading_splitting()
|
143 |
#document_storage_mongodb(splits)
|
144 |
db = document_retrieval_mongodb(llm, prompt)
|
145 |
completion = rag_chain(llm, prompt, db)
|
146 |
+
completion = completion["result"]
|
147 |
else:
|
148 |
+
completion = llm_chain(llm, prompt)
|
|
|
149 |
except Exception as e:
|
150 |
raise gr.Error(e)
|
151 |
finally:
|
152 |
wandb_log(prompt, completion, rag_option)
|
153 |
+
return completion
|
154 |
|
155 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application using a <strong>large language model (LLM)</strong> with
|
156 |
<strong>retrieval augmented generation (RAG)</strong>.
|