geeksiddhant commited on
Commit
fdefb29
Β·
verified Β·
1 Parent(s): 23d13fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -1,7 +1,16 @@
1
  import gradio as gr
 
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
 
 
 
 
 
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ chatbot = pipeline("conversational", model="microsoft/DialoGPT-medium")
5
+
6
+ def chatbot_response(user_input):
7
+ response = chatbot(user_input)
8
+ return response[0]["generated_text"]
9
+
10
+ iface = gr.Interface(
11
+ fn=chatbot_response,
12
+ inputs=gr.inputs.Textbox(lines=2, placeholder="Type a message..."),
13
+ outputs="text"
14
+ )
15
 
 
16
  iface.launch()