Instructions to use paragon-AI/blip2-image-to-text with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use paragon-AI/blip2-image-to-text 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="paragon-AI/blip2-image-to-text")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("paragon-AI/blip2-image-to-text") model = AutoModelForMultimodalLM.from_pretrained("paragon-AI/blip2-image-to-text") - Notebooks
- Google Colab
- Kaggle
Error
Could not load model paragon-AI/blip2-image-to-text with any of the following classes: (<class 'transformers.models.blip_2.modeling_blip_2.Blip2ForConditionalGeneration'>,). See the original errors: while loading with Blip2ForConditionalGeneration, an error is thrown: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/transformers/pipelines/base.py", line 283, in infer_framework_load_model model = model_class.from_pretrained(model, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/transformers/modeling_utils.py", line 3406, in from_pretrained raise EnvironmentError( OSError: paragon-AI/blip2-image-to-text does not appear to have a file named pytorch_model.bin, tf_model.h5, model.ckpt or flax_model.msgpack.