Spaces:
No application file
No application file
Create app.py
Browse files12345678910111213141516171819202122!pip install transformers!pip install gradio!pip install gradio_clientpip install -U gradio_clientfrom transformers.utils import logginglogging.set_verbosity_error()
import warningswarnings.filterwarnings("ignore", message="Using the model-agnostic default `max_length`")import osimport gradio as grfrom transformers import pipelinepipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")def launch(input): out = pipe(input) return out[0]['generated_text']iface = gr.Interface(launch, inputs=gr.Image(type='pil'), outputs="text") iface.launch()app.pyAdded+22