Spaces:
Paused
Paused
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) |