Spaces:
Sleeping
Sleeping
Commit
·
04cdce4
1
Parent(s):
8cb5991
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline, Conversation, BlenderbotTokenizer, BlenderbotForConditionalGeneration
|
3 |
-
import random
|
4 |
|
5 |
tokenizer = BlenderbotTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
|
6 |
model = BlenderbotForConditionalGeneration.from_pretrained("model")
|
@@ -19,7 +18,6 @@ def model_generate(text, state = None):
|
|
19 |
return converse.generated_responses[-1]
|
20 |
|
21 |
def get_response(text, history) -> str:
|
22 |
-
chatbot.generator.set_seed(random.randint(0, 101))
|
23 |
output = model_generate(text, converse)
|
24 |
return output
|
25 |
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline, Conversation, BlenderbotTokenizer, BlenderbotForConditionalGeneration
|
|
|
3 |
|
4 |
tokenizer = BlenderbotTokenizer.from_pretrained("facebook/blenderbot-400M-distill")
|
5 |
model = BlenderbotForConditionalGeneration.from_pretrained("model")
|
|
|
18 |
return converse.generated_responses[-1]
|
19 |
|
20 |
def get_response(text, history) -> str:
|
|
|
21 |
output = model_generate(text, converse)
|
22 |
return output
|
23 |
|