Spaces:
Runtime error
Runtime error
Download app.py from pstayal/blip-image-caption-api-tutorial: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/spaces/pstayal/blip-image-caption-api-tutorial/resolve/main/app.py
- Command line
-
hf download hf://spaces/pstayal/blip-image-caption-api-tutorial/app.py
-
curl -L -o app.py https://huggingface.co/spaces/pstayal/blip-image-caption-api-tutorial/resolve/main/app.py
442 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| pipe = pipeline("visual-question-answering", model = "openbmb/MiniCPM-Llama3-V-2_5", trust_remote_code=True) | |
| #model="Salesforce/blip2-opt-2.7b") | |
| def launch(input1, input2): | |
| out = pipe(input1, input2) | |
| return out#['generated_text'] | |
| iface = gr.Interface(launch, | |
| inputs=[gr.Image(type='pil'), gr.Textbox()], | |
| outputs="text") | |
| iface.launch() |