Spaces:
No application file
No application file
Update app.py
Browse files1234567891011121314151617181920!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()12345678910111213import 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.inputs.Image(type='pil'),outputs="text")iface.launch(share=True)
app.py+7-14