Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def chatbot_response(user_message, history=[]):
|
|
59 |
response = chatbot_tokenizer.decode(outputs[0], skip_special_tokens=True)
|
60 |
'''
|
61 |
# tokenize the new input sentence
|
62 |
-
new_user_input_ids = chatbot_tokenizer.encode(
|
63 |
|
64 |
# append the new user input tokens to the chat history
|
65 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|
|
|
59 |
response = chatbot_tokenizer.decode(outputs[0], skip_special_tokens=True)
|
60 |
'''
|
61 |
# tokenize the new input sentence
|
62 |
+
new_user_input_ids = chatbot_tokenizer.encode(user_message + chatbot_tokenizer.eos_token, return_tensors='pt')
|
63 |
|
64 |
# append the new user input tokens to the chat history
|
65 |
bot_input_ids = torch.cat([torch.LongTensor(history), new_user_input_ids], dim=-1)
|