Spaces:
Runtime error
Runtime error
kingabzpro
commited on
Commit
β’
c5d4c43
1
Parent(s):
88357f1
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,10 @@ The bot is trained on blended_skill_talk dataset using facebook/blenderbot-400M-
|
|
13 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1907.06616' target='_blank'>Recipes for building an open-domain chatbot</a></p><p style='text-align: center'><a href='https://parl.ai/projects/recipes/' target='_blank'>Original PARLAI Code</a></p></center></p>"
|
14 |
|
15 |
import torch
|
16 |
-
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM
|
17 |
|
18 |
-
tokenizer =
|
19 |
-
model =
|
20 |
|
21 |
def predict(input, history=[]):
|
22 |
# tokenize the new input sentence
|
|
|
13 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/1907.06616' target='_blank'>Recipes for building an open-domain chatbot</a></p><p style='text-align: center'><a href='https://parl.ai/projects/recipes/' target='_blank'>Original PARLAI Code</a></p></center></p>"
|
14 |
|
15 |
import torch
|
16 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM, BlenderbotForCausalLM, BlenderbotTokenizer
|
17 |
|
18 |
+
tokenizer = BlenderbotTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
|
19 |
+
model = BlenderbotForCausalLM.from_pretrained("facebook/blenderbot-400M-distill")
|
20 |
|
21 |
def predict(input, history=[]):
|
22 |
# tokenize the new input sentence
|