Bhaddy392 commited on
Commit
5a96fee
·
verified ·
1 Parent(s): ca369a7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ pipe = pipeline("text-generation", model="microsoft/DialoGPT-small")
5
+
6
+ def chat(message, history):
7
+ if not message:
8
+ return ""
9
+
10
+ response = pipe(message, max_length=100, pad_token_id=50256)
11
+ return response[0]["generated_text"]
12
+
13
+ gr.ChatInterface(fn=chat).launch()