003 / app.py
CaiRou-Huang's picture
Update app.py
1c427fd
raw
history blame contribute delete
No virus
303 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("text-generation")
def predict(prompt):
completion = pipe(prompt, max_length=50, num_return_sequences=1)[0]["generated_text"]
return completion
iface = gr.Interface(fn=predict, inputs="text", outputs="text")
iface.launch()