Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -73,6 +73,12 @@ def ai_predicted(user_input):
|
|
73 |
ai_response = query({
|
74 |
"inputs": user_input,
|
75 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
# ai_response = conversation_predict(user_input)
|
77 |
# ai_response_lines = ai_response.split("</s>")
|
78 |
|
|
|
73 |
ai_response = query({
|
74 |
"inputs": user_input,
|
75 |
})
|
76 |
+
if 'generated_text' in response_json[0]:
|
77 |
+
ai_response = response_json[0]['generated_text']
|
78 |
+
elif 'text' in response_json[0]:
|
79 |
+
ai_response = response_json[0]['text']
|
80 |
+
else:
|
81 |
+
ai_response = response_json[0]
|
82 |
# ai_response = conversation_predict(user_input)
|
83 |
# ai_response_lines = ai_response.split("</s>")
|
84 |
|