import gradio as gr from transformers import pipeline captioner = pipeline(model="microsoft/git-base") def predict(image): return captioner(image)[0]["generated_text"] demo = gr.Interface( fn=predict, inputs=gr.Image, outputs='text' ) demo.launch() # gr.Interface.load("models/ronniet/git-base-env").launch() # gr.Interface.load("models/microsoft/git-base").launch()