Spaces:
Build error
Build error
File size: 439 Bytes
e38d825 4257568 e38d825 4257568 e38d825 4257568 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import gradio as gr
from transformers import pipeline
# def greet(name):
# return "Hello " + name + "!!"
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
# iface.launch()
model = pipeline("text-generation")
def predict(prompt):
completion = model(prompt)[0]["generated_text"]
return completion
predict("My favorite programming language is")
gr.Interface(fn=predict, inputs="text", outputs="text").launch() |