Guilherme34
commited on
Commit
•
a189440
1
Parent(s):
b0f37e9
Update chat.py
Browse files
chat.py
CHANGED
@@ -48,7 +48,7 @@ def generate_response(message, history):
|
|
48 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
49 |
|
50 |
# Extract only the assistant's response
|
51 |
-
assistant_response = response.
|
52 |
|
53 |
return assistant_response
|
54 |
except Exception as e:
|
|
|
48 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
49 |
|
50 |
# Extract only the assistant's response
|
51 |
+
assistant_response = response.split("<|im_start|>assistant\n")[-1]
|
52 |
|
53 |
return assistant_response
|
54 |
except Exception as e:
|