Spaces:
Sleeping
Sleeping
Utkarsh Verma
commited on
Commit
·
74e7f7c
1
Parent(s):
f82e1c0
Code Change
Browse files
app.py
CHANGED
@@ -47,11 +47,11 @@ def chat():
|
|
47 |
if "error" in data:
|
48 |
return jsonify({"reply": f"Error: {data['error']}"})
|
49 |
|
50 |
-
|
51 |
|
52 |
-
raw_output = data[0]['generated_text'] if isinstance(data, list) else data.get('generated_text', "No response")
|
53 |
# Extract only the part after "Bot:"
|
54 |
-
reply = raw_output.split("Bot:")[-1].strip()
|
55 |
return jsonify({"reply": reply})
|
56 |
|
57 |
except Exception as e:
|
|
|
47 |
if "error" in data:
|
48 |
return jsonify({"reply": f"Error: {data['error']}"})
|
49 |
|
50 |
+
reply = data[0]['generated_text'] if isinstance(data, list) else data.get('generated_text', "No response")
|
51 |
|
52 |
+
#raw_output = data[0]['generated_text'] if isinstance(data, list) else data.get('generated_text', "No response")
|
53 |
# Extract only the part after "Bot:"
|
54 |
+
#reply = raw_output.split("Bot:")[-1].strip()
|
55 |
return jsonify({"reply": reply})
|
56 |
|
57 |
except Exception as e:
|