Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,15 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
-
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
7 |
|
|
|
|
|
|
|
|
|
8 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
# Load the model
|
5 |
+
chatbot = pipeline("text-generation", model="facebook/blenderbot-400M-distill")
|
6 |
|
7 |
+
def chat_response(message):
|
8 |
+
response = chatbot(message, max_length=100, do_sample=True)
|
9 |
+
return response[0]['generated_text']
|
10 |
|
11 |
+
# Create Gradio interface
|
12 |
+
iface = gr.Interface(fn=chat_response, inputs="text", outputs="text", title="Bit GPT 0.2.8")
|
13 |
+
|
14 |
+
# Launch app
|
15 |
iface.launch()
|