talinm2's picture
Create app.py
56a0e24 verified
raw
history blame contribute delete
365 Bytes
import os
import gradio as gr
from transformers import pipeline
model_id = "Salesforce/blip-vqa-base"
pipe = pipeline("image-to-text", model=model_id)
def launch(input):
out = pipe(input)
return out[0]['generated_text']
iface = gr.Interface(launch,
inputs=gr.Image(type='pil'),
outputs="text")
iface.launch()