Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

nlpconnect
/
vit-gpt2-image-captioning

Image-to-Text
Transformers
PyTorch
vision-encoder-decoder
image-text-to-text
image-captioning
Model card Files Files and versions
xet
Community
53

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, AutoModelForImageTextToText
    
    tokenizer = AutoTokenizer.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
    model = AutoModelForImageTextToText.from_pretrained("nlpconnect/vit-gpt2-image-captioning")
  • Notebooks
  • Google Colab
  • Kaggle
vit-gpt2-image-captioning
985 MB
Ctrl+K
Ctrl+K
  • 5 contributors
History: 14 commits
ankur310794's picture
ankur310794
commonslash's picture
commonslash
Updates README.md sample running code to remove FutureWarning deprecation error for `ViTFeatureExtractor`. (#14)
dc68f91 about 3 years ago
  • .gitattributes
    1.18 kB
    initial commit over 4 years ago
  • README.md
    2.7 kB
    Updates README.md sample running code to remove FutureWarning deprecation error for `ViTFeatureExtractor`. (#14) about 3 years ago
  • config.json
    4.61 kB
    add model over 4 years ago
  • merges.txt
    456 kB
    add tokenizer over 4 years ago
  • preprocessor_config.json
    228 Bytes
    add tokenizer over 4 years ago
  • pytorch_model.bin

    Detected Pickle imports (4)

    • "torch.ByteStorage",
    • "collections.OrderedDict",
    • "torch.FloatStorage",
    • "torch._utils._rebuild_tensor_v2"

    What is a pickle import?

    982 MB
    xet
    add model over 4 years ago
  • special_tokens_map.json
    120 Bytes
    add tokenizer over 4 years ago
  • tokenizer.json
    1.36 MB
    add tokenizer over 4 years ago
  • tokenizer_config.json
    241 Bytes
    add tokenizer over 4 years ago
  • vocab.json
    798 kB
    add tokenizer over 4 years ago