Spaces:
Sleeping
Sleeping
Commit
·
7502f2a
1
Parent(s):
e66b629
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,15 @@ llm_chain = LLMChain(
|
|
25 |
)
|
26 |
|
27 |
def get_text_response(user_message,history):
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
return response
|
30 |
|
31 |
demo = gr.ChatInterface(get_text_response)
|
|
|
25 |
)
|
26 |
|
27 |
def get_text_response(user_message,history):
|
28 |
+
try:
|
29 |
+
response = llm_chain.predict(user_message = user_message)
|
30 |
+
except Exception as e:
|
31 |
+
print("Error:", e)
|
32 |
+
try:
|
33 |
+
print("Error:", e.error.message)
|
34 |
+
response = "Failed to reply: " + e.error.message
|
35 |
+
except Exception as e:
|
36 |
+
response = "Failed to reply"
|
37 |
return response
|
38 |
|
39 |
demo = gr.ChatInterface(get_text_response)
|