File size: 302 Bytes
cc7c9c3
f495ca0
cc7c9c3
f495ca0
cc7c9c3
f495ca0
cc7c9c3
f495ca0
 
 
 
 
cc7c9c3
f495ca0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import gradio as gr
from transformers import pipeline

my_model = "."

model = pipeline("text-generation", model=my_model)

def predict(prompt):
  completion = model(prompt, max_length=50)[0]["generated_text"]
  return completion
  
gr.Interface(fn=predict, inputs="text", outputs="text").launch()