Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def converse(user_input, chat_history=[]):
|
|
15 |
user_input_ids = chat_tkn(user_input + chat_tkn.eos_token, return_tensors='pt').input_ids
|
16 |
|
17 |
# create a combined tensor with chat history
|
18 |
-
bot_input_ids = torch.
|
19 |
|
20 |
# generate a response
|
21 |
chat_history = mdl.generate(bot_input_ids, max_length=1000, pad_token_id=chat_tkn.eos_token_id).tolist()
|
|
|
15 |
user_input_ids = chat_tkn(user_input + chat_tkn.eos_token, return_tensors='pt').input_ids
|
16 |
|
17 |
# create a combined tensor with chat history
|
18 |
+
bot_input_ids = torch.cat([torch.LongTensor(chat_history), user_input_ids], dim=-1)
|
19 |
|
20 |
# generate a response
|
21 |
chat_history = mdl.generate(bot_input_ids, max_length=1000, pad_token_id=chat_tkn.eos_token_id).tolist()
|