Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,8 @@ def chat():
|
|
| 58 |
if response.status_code == 200:
|
| 59 |
response_json = response.json()
|
| 60 |
ai_response = response_json.get("response", "No 'response' key found in the JSON.")
|
| 61 |
-
|
|
|
|
| 62 |
else:
|
| 63 |
return jsonify({
|
| 64 |
"error": "Error from PythonAnywhere",
|
|
|
|
| 58 |
if response.status_code == 200:
|
| 59 |
response_json = response.json()
|
| 60 |
ai_response = response_json.get("response", "No 'response' key found in the JSON.")
|
| 61 |
+
ai_response = ai_response.encode('latin1').decode('utf-8', 'ignore')
|
| 62 |
+
return (ai_response)})
|
| 63 |
else:
|
| 64 |
return jsonify({
|
| 65 |
"error": "Error from PythonAnywhere",
|