File size: 275 Bytes
eb53c79
 
 
 
 
 
 
 
 
304d993
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
from transformers import pipeline

model = pipeline("text-generation")


def predict(prompt):
    completion = model(prompt)[0]["generated_text"]
    return completion


import gradio as gr

gr.Interface(fn=predict, inputs="text", outputs="text").launch()