Spaces:
Sleeping
Sleeping
caaxgave
commited on
Commit
•
2c8adcc
1
Parent(s):
82f9b3d
App fixes
Browse files
app.py
CHANGED
@@ -1,7 +1,17 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline, Conversation
|
2 |
import gradio as gr
|
3 |
|
4 |
+
# defining model
|
5 |
+
chatbot = pipeline(model="facebook/blenderbot-400M-distill")
|
6 |
|
7 |
+
message_list = []
|
8 |
+
response_list = []
|
9 |
+
|
10 |
+
|
11 |
+
def vanilla_chatbot(user_message, history):
|
12 |
+
conversation = chatbot(user_message)
|
13 |
+
return conversation[0]["generated_text"]
|
14 |
+
|
15 |
+
demo_chatbot = gr.ChatInterface(vanilla_chatbot, title="Vanilla Chatbot", description="Enter text to start chatting.")
|
16 |
+
|
17 |
+
demo_chatbot.launch()
|