smjain commited on
Commit
1fc8b87
·
1 Parent(s): 2342136

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,11 +1,13 @@
1
- from transformers import AutoModelForCausalLM, AutoTokenizer
 
 
2
  import torch
3
 
4
- chat_tkn = AutoTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
5
- mdl = AutoModelForCausalLM.from_pretrained("facebook/blenderbot-400M-distill")
6
 
7
  def converse(user_input, chat_history=[]):
8
- # tokenize the new input sentence
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