import gradio as gr from transformers import pipeline pipe = pipeline(task="image-to-text", model="Stoneman/IG-caption-generator-nlpconnect-last-block") # Example images examples = [f"example{i}.JPG" for i in range(1, 10)] gr.Interface.from_pipeline(pipe, title="IG-caption-generator", description="IG caption generator using ViT and GPT2.", examples=examples ).launch()