Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -116,7 +116,8 @@ def rag_chain(llm, prompt, db):
|
|
116 |
return completion, rag_chain
|
117 |
|
118 |
def wandb_trace(rag_option, prompt, completion, chain, status_msg, start_time_ms, end_time_ms):
|
119 |
-
|
|
|
120 |
wandb.init(project = "openai-llm-rag")
|
121 |
if (rag_option == "Off" or str(status_msg) != ""):
|
122 |
result = completion
|
@@ -159,7 +160,7 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
159 |
raise gr.Error("Prompt is required.")
|
160 |
completion = ""
|
161 |
result = ""
|
162 |
-
chain =
|
163 |
status_msg = ""
|
164 |
try:
|
165 |
start_time_ms = round(time.time() * 1000)
|
|
|
116 |
return completion, rag_chain
|
117 |
|
118 |
def wandb_trace(rag_option, prompt, completion, chain, status_msg, start_time_ms, end_time_ms):
|
119 |
+
if (chain != None):
|
120 |
+
print(chain.type)
|
121 |
wandb.init(project = "openai-llm-rag")
|
122 |
if (rag_option == "Off" or str(status_msg) != ""):
|
123 |
result = completion
|
|
|
160 |
raise gr.Error("Prompt is required.")
|
161 |
completion = ""
|
162 |
result = ""
|
163 |
+
chain = None
|
164 |
status_msg = ""
|
165 |
try:
|
166 |
start_time_ms = round(time.time() * 1000)
|