Update services/chat_service.py
Browse files- services/chat_service.py +2 -0
services/chat_service.py
CHANGED
|
@@ -237,6 +237,8 @@ class ChatService:
|
|
| 237 |
|
| 238 |
response = self.tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
|
| 239 |
|
|
|
|
|
|
|
| 240 |
|
| 241 |
return response.strip()
|
| 242 |
|
|
|
|
| 237 |
|
| 238 |
response = self.tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True)
|
| 239 |
|
| 240 |
+
# Remove potential repeated assistant text
|
| 241 |
+
response = response.replace("<|assistant|>", "").strip()
|
| 242 |
|
| 243 |
return response.strip()
|
| 244 |
|