Spaces:
Sleeping
Sleeping
Update app/response_generator.py
Browse files
app/response_generator.py
CHANGED
|
@@ -31,10 +31,10 @@ def generate_support_message(text: str, emotion: str) -> str:
|
|
| 31 |
)
|
| 32 |
|
| 33 |
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 34 |
-
|
| 35 |
if "Assistant:" in decoded:
|
| 36 |
-
response = decoded.split("Assistant:")[-1].strip()
|
| 37 |
else:
|
| 38 |
response = decoded.strip()
|
| 39 |
|
| 40 |
-
return response
|
|
|
|
| 31 |
)
|
| 32 |
|
| 33 |
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 34 |
+
|
| 35 |
if "Assistant:" in decoded:
|
| 36 |
+
response = decoded.split("Assistant:")[-1].split("User message:")[0].strip()
|
| 37 |
else:
|
| 38 |
response = decoded.strip()
|
| 39 |
|
| 40 |
+
return response
|