Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -143,8 +143,7 @@ def wandb_trace(rag_option, prompt, completion, chain, status_msg, start_time_ms
|
|
143 |
"prompt": str(prompt if (str(status_msg) == "") else ""),
|
144 |
"prompt_template": str((llm_template if (rag_option == RAG_OFF) else rag_template) if (str(status_msg) == "") else ""),
|
145 |
"docs_meta": "" if (rag_option == RAG_OFF or str(status_msg) != "") else docs_meta},
|
146 |
-
outputs = {
|
147 |
-
"completion": completion},
|
148 |
start_time_ms = start_time_ms,
|
149 |
end_time_ms = end_time_ms
|
150 |
)
|
@@ -180,8 +179,9 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
180 |
completion, chain = rag_chain(llm, prompt, db)
|
181 |
result = completion["result"]
|
182 |
else:
|
183 |
-
|
184 |
-
result
|
|
|
185 |
except Exception as e:
|
186 |
status_msg = e
|
187 |
raise gr.Error(e)
|
|
|
143 |
"prompt": str(prompt if (str(status_msg) == "") else ""),
|
144 |
"prompt_template": str((llm_template if (rag_option == RAG_OFF) else rag_template) if (str(status_msg) == "") else ""),
|
145 |
"docs_meta": "" if (rag_option == RAG_OFF or str(status_msg) != "") else docs_meta},
|
146 |
+
outputs = {"result": result},
|
|
|
147 |
start_time_ms = start_time_ms,
|
148 |
end_time_ms = end_time_ms
|
149 |
)
|
|
|
179 |
completion, chain = rag_chain(llm, prompt, db)
|
180 |
result = completion["result"]
|
181 |
else:
|
182 |
+
result, chain = llm_chain(llm, prompt)
|
183 |
+
print(result)
|
184 |
+
completion = result
|
185 |
except Exception as e:
|
186 |
status_msg = e
|
187 |
raise gr.Error(e)
|