Instructions to use Salesforce/blip-image-captioning-large with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Salesforce/blip-image-captioning-large with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-large")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-large") model = AutoModelForImageTextToText.from_pretrained("Salesforce/blip-image-captioning-large") - Notebooks
- Google Colab
- Kaggle
How do I create an Inference Endpoint with this model?
Hi all,
I am a newbie - so I would like to generate an inference Endpoint with this model, but everytime I try doing that I get an error saying that the repo doesn't have a "handler.py" file hence it won't work.
I know that I can create my own custom "handler.py" file, but when I do I get all sort of errors in the repo - mainly is because I am not sure how to include all other pytorch bin files that are needed in the repo.
Any help is highly appreciated.
Thank you.
Paulo
Hi @pdich2085
A while back, @florentgbelidji made an endpoint using HF implementation here: https://huggingface.co/florentgbelidji/blip_vqa/tree/main
Can you adapt it to use the image captioning model and let us know how it goes?