Spaces:
No application file
No application file
Update app.py
Browse files123456789101231345678910181920111213!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 pipeline
pipe = pipeline("image-to-text,model="Salesforce/blip-image-captioning-base")pipe = 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() inputs=gr.inputs.Image(type='pil'), outputs="text")iface.launch(share=True)app.py+7-14