Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ def chat_with_model(user_input, chat_history=[]):
|
|
112 |
# response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
113 |
|
114 |
# Decode and clean the response to remove unwanted repetitions of "assistant"
|
115 |
-
response =
|
116 |
|
117 |
# Remove potential repeated assistant text
|
118 |
response = response.replace("<|assistant|>", "").strip()
|
|
|
112 |
# response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
113 |
|
114 |
# Decode and clean the response to remove unwanted repetitions of "assistant"
|
115 |
+
response = tokenizer.decode(outputs[0][input_ids.shape[-1]:], skip_special_tokens=True).strip()
|
116 |
|
117 |
# Remove potential repeated assistant text
|
118 |
response = response.replace("<|assistant|>", "").strip()
|