Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ mdl = AutoModelForCausalLM.from_pretrained("facebook/blenderbot-400M-distill")
|
|
10 |
|
11 |
def converse(user_input, chat_history=[]):
|
12 |
|
13 |
-
user_input_ids = chat_tkn(user_input + chat_tkn.eos_token, return_tensors='pt')
|
14 |
|
15 |
# create a combined tensor with chat history
|
16 |
bot_input_ids = torch.cat([torch.LongTensor(chat_history), user_input_ids], dim=-1)
|
|
|
10 |
|
11 |
def converse(user_input, chat_history=[]):
|
12 |
|
13 |
+
user_input_ids = chat_tkn.encode(user_input + chat_tkn.eos_token, return_tensors='pt')
|
14 |
|
15 |
# create a combined tensor with chat history
|
16 |
bot_input_ids = torch.cat([torch.LongTensor(chat_history), user_input_ids], dim=-1)
|