Instructions to use nlpconnect/vit-gpt2-image-captioning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nlpconnect/vit-gpt2-image-captioning 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="nlpconnect/vit-gpt2-image-captioning")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning") model = AutoModelForMultimodalLM.from_pretrained("nlpconnect/vit-gpt2-image-captioning") - Notebooks
- Google Colab
- Kaggle
Update preprocessor_config.json to use image_processor_type
#32
by ensaimado - opened
This pull request addresses a warning message that appears when using the nlpconnect/vit-gpt2-image-captioning model. The warning suggests updating the preprocessor_config.json file to use image_processor_type instead of feature_extractor_type.
Changes made:
- Renamed
feature_extractor_typetoimage_processor_typeinpreprocessor_config.json.
This change should help to align the model's configuration with the latest practices in the transformers library and remove the warning message for users of the model.