Piux24 commited on
Commit
f1c5082
·
verified ·
1 Parent(s): cb3277e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1,8 +1,15 @@
1
  import gradio as gr
 
2
 
3
- def chat(message, history):
4
- return "Hello! This is BIT-GPT 0.2.8 responding."
5
 
6
- iface = gr.ChatInterface(chat)
 
 
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()