Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -47,12 +47,10 @@ def invoke(openai_api_key, prompt, agent_option):
|
|
47 |
|
48 |
result = completion["output"]
|
49 |
elif (agent_option == AGENT_LLAMAINDEX):
|
50 |
-
print("111")
|
51 |
result = agent_llamaindex(
|
52 |
config,
|
53 |
prompt
|
54 |
)
|
55 |
-
print("222")
|
56 |
else:
|
57 |
client = OpenAI()
|
58 |
|
@@ -65,12 +63,10 @@ def invoke(openai_api_key, prompt, agent_option):
|
|
65 |
callback = completion.usage
|
66 |
result = completion.choices[0].message.content
|
67 |
except Exception as e:
|
68 |
-
print("333")
|
69 |
err_msg = e
|
70 |
|
71 |
raise gr.Error(e)
|
72 |
finally:
|
73 |
-
print("444")
|
74 |
end_time_ms = round(time.time() * 1000)
|
75 |
|
76 |
trace_wandb(
|
@@ -84,9 +80,7 @@ def invoke(openai_api_key, prompt, agent_option):
|
|
84 |
start_time_ms,
|
85 |
end_time_ms
|
86 |
)
|
87 |
-
print("555")
|
88 |
|
89 |
-
#print("666" + result)
|
90 |
return result
|
91 |
|
92 |
gr.close_all()
|
|
|
47 |
|
48 |
result = completion["output"]
|
49 |
elif (agent_option == AGENT_LLAMAINDEX):
|
|
|
50 |
result = agent_llamaindex(
|
51 |
config,
|
52 |
prompt
|
53 |
)
|
|
|
54 |
else:
|
55 |
client = OpenAI()
|
56 |
|
|
|
63 |
callback = completion.usage
|
64 |
result = completion.choices[0].message.content
|
65 |
except Exception as e:
|
|
|
66 |
err_msg = e
|
67 |
|
68 |
raise gr.Error(e)
|
69 |
finally:
|
|
|
70 |
end_time_ms = round(time.time() * 1000)
|
71 |
|
72 |
trace_wandb(
|
|
|
80 |
start_time_ms,
|
81 |
end_time_ms
|
82 |
)
|
|
|
83 |
|
|
|
84 |
return result
|
85 |
|
86 |
gr.close_all()
|