Instructions to use bipin/image-caption-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bipin/image-caption-generator 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="bipin/image-caption-generator")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("bipin/image-caption-generator") model = AutoModelForImageTextToText.from_pretrained("bipin/image-caption-generator") - Notebooks
- Google Colab
- Kaggle
Error
Can't load tokenizer using from_pretrained, please update its configuration: <class 'transformers.models.vision_encoder_decoder.configuration_vision_encoder_decoder.VisionEncoderDecoderConfig'>
Hi @bipin ,sorry for my late response. I only noticed the popup message now.
I tried it again and received the following error:
{"error":"Can't load tokenizer using from_pretrained, please update its configuration: <class 'transformers.models.vision_encoder_decoder.configuration_vision_encoder_decoder.VisionEncoderDecoderConfig'>"}
Hi @bipin ,sorry for my late response. I only noticed the popup message now.
I tried it again and received the following error:
{"error":"Can't load tokenizer using from_pretrained, please update its configuration: <class 'transformers.models.vision_encoder_decoder.configuration_vision_encoder_decoder.VisionEncoderDecoderConfig'>"}
Which version of the transformers library are you using? Are you trying with the code in the model card and are you running on Google colab or locally?
Hi @bipin ,sorry for my late response. I only noticed the popup message now.
I tried it again and received the following error:
{"error":"Can't load tokenizer using from_pretrained, please update its configuration: <class 'transformers.models.vision_encoder_decoder.configuration_vision_encoder_decoder.VisionEncoderDecoderConfig'>"}
Which version of the transformers library are you using? Are you trying with the code in the model card and are you running on Google colab or locally?
I used the "Inference API" on the "model card"-page of https://huggingface.co/bipin/image-caption-generator