Spaces:
Paused
Paused
File size: 432 Bytes
24304e1 f18eb47 24304e1 675211a 24304e1 f18eb47 24304e1 f18eb47 a837e17 f18eb47 24304e1 f18eb47 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import gradio as gr
from transformers import pipeline
pipeline = pipeline(task="text-generation", model="Preetham04/text-generation")
def predict(input_img):
predictions = pipeline(input_img)
return {p["label"]: p["score"] for p in predictions}
gradio_app = gr.Interface(
predict,
inputs="textbox",
outputs="text",
title="Text-generation",
)
if __name__ == "__main__":
gradio_app.launch(share=True) |