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")# pip install -U transformers accelerate # 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", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download pytorch_model.bin from nlpconnect/vit-gpt2-image-captioning: direct link, hf CLI and curl.
- Browser
- Download file 982 MB
-
https://huggingface.co/nlpconnect/vit-gpt2-image-captioning/resolve/main/pytorch_model.bin
- Command line
-
hf download hf://nlpconnect/vit-gpt2-image-captioning/pytorch_model.bin
-
curl -L -o pytorch_model.bin https://huggingface.co/nlpconnect/vit-gpt2-image-captioning/resolve/main/pytorch_model.bin
982 MB
- Xet hash:
- 10501c02fa6ce360642cc46ec56b2c166b05bee4a06aba77b99c330f9e4cef8c
- Size of remote file:
- 982 MB
- SHA256:
- 2605a69b760d0b218c3b5d2069ba070d28f279a16ce4bc87bf019b75a91553e6
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.