Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,13 @@
|
|
1 |
-
from transformers import
|
|
|
|
|
2 |
import torch
|
3 |
|
4 |
-
chat_tkn =
|
5 |
-
mdl =
|
6 |
|
7 |
def converse(user_input, chat_history=[]):
|
8 |
-
#
|
9 |
user_input_ids = chat_tkn(input + chat_tkn.eos_token, return_tensors='pt')
|
10 |
|
11 |
# append the new user input tokens to the chat history
|
|
|
1 |
+
from transformers import BlenderbotTokenizer, BlenderbotForConditionalGeneration
|
2 |
+
|
3 |
+
|
4 |
import torch
|
5 |
|
6 |
+
chat_tkn = BlenderbotTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
|
7 |
+
mdl = BlenderbotForConditionalGeneration.from_pretrained("facebook/blenderbot-400M-distill")
|
8 |
|
9 |
def converse(user_input, chat_history=[]):
|
10 |
+
#tkn_ids = chat_tkn(input(">> User:") + chat_tkn.eos_token, return_tensors='pt')
|
11 |
user_input_ids = chat_tkn(input + chat_tkn.eos_token, return_tensors='pt')
|
12 |
|
13 |
# append the new user input tokens to the chat history
|