Bull / app.py
Thebull's picture
Update app.py
5c4636b verified
raw
history blame
353 Bytes
import gradio as gr
from transformers import pipeline
dialogpt = pipeline("text-generation", model="microsoft/DialoGPT-medium")
def respond(context):
response = dialogpt(context, max_length=100, do_sample=True)
return response[0]['generated_text'][len(context):]
iface = gr.Interface(fn=respond, inputs="text", outputs="text")
iface.launch()