Dhahlan2000 commited on
Commit
867e9e0
·
verified ·
1 Parent(s): dfaa287

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
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