Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,11 +64,11 @@ def handle_query(query):
|
|
| 64 |
try:
|
| 65 |
data=json.loads(response.content.decode("utf-8"))
|
| 66 |
result=data[0]['generated_text']
|
| 67 |
-
last_comma_index = result.rfind('
|
| 68 |
|
| 69 |
# If a comma is found, slice the string from the last comma onwards
|
| 70 |
if last_comma_index != -1:
|
| 71 |
-
result = result[last_comma_index +
|
| 72 |
|
| 73 |
return result
|
| 74 |
except:
|
|
|
|
| 64 |
try:
|
| 65 |
data=json.loads(response.content.decode("utf-8"))
|
| 66 |
result=data[0]['generated_text']
|
| 67 |
+
last_comma_index = result.rfind('|eot_id|>assistant')
|
| 68 |
|
| 69 |
# If a comma is found, slice the string from the last comma onwards
|
| 70 |
if last_comma_index != -1:
|
| 71 |
+
result = result[last_comma_index + 18:].strip()
|
| 72 |
|
| 73 |
return result
|
| 74 |
except:
|