AI SeedbankHelp preserve open and free AI for humanity's future

← All models

Salesforce_blip2-opt-2.7b

Salesforce · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


language: en license: mit tags:

  • vision
  • image-to-text
  • image-captioning
  • visual-question-answering pipeline_tag: image-text-to-text

BLIP-2, OPT-2.7b, pre-trained only

BLIP-2 model, leveraging OPT-2.7b (a large language model with 2.7 billion parameters). It was introduced in the paper BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language Models by Li et al. and first released in this repository.

Disclaimer: The team releasing BLIP-2 did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

BLIP-2 consists of 3 models: a CLIP-like image encoder, a Querying Transformer (Q-Former) and a large language model.

The authors initialize the weights of the image encoder and large language model from pre-trained checkpoints and keep them frozen while training the Querying Transformer, which is a BERT-like Transformer encoder that maps a set of "query tokens" to query embeddings, which bridge the gap between the embedding space of the image encoder and the large language model.

The goal for the model is simply to predict the next text token, giving the query embeddings and the previous text.

This allows the model to be used for tasks like:

  • image captioning
  • visual question answering (VQA)
  • chat-like conversations by feeding the image and the previous conversation as prompt to the model

Direct Use and Downstream Use

You can use the raw model for conditional text generation given an image and optional text. See the model hub to look for fine-tuned versions on a task that interests you.

Bias, Risks, Limitations, and Ethical Considerations

BLIP2-OPT uses off-the-shelf OPT as the language model. It inherits the same risks and limitations as mentioned in Meta's model card.

Like other large language models for which the diversity (or lack thereof) of training data induces downstream impact on the quality of our model, OPT-175B has limitations in terms of bias and safety. OPT-175B can also have quality issues in terms of generation diversity and hallucination. In general, OPT-175B is not immune from the plethora of issues that plague modern large language models.

BLIP2 is fine-tuned on image-text datasets (e.g. LAION ) collected from the internet. As a result the model itself is potentially vulnerable to generating equivalently inappropriate content or replicating inherent biases in the underlying data.

BLIP2 has not been tested in real world applications. It should not be directly deployed in any applications. Researchers should first carefully assess the safety and fairness of the model in relation to the specific context they’re being deployed within.

Ethical Considerations

This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people’s lives, rights, or safety. For further guidance on use cases, refer to our AUP and AI AUP.

How to use

For code examples, we refer to the documentation.

Memory requirements

The memory requirements differ based on the precision one uses. One can use 4-bit inference using Bitsandbytes, which greatly reduce the memory requirements.

dtype Largest Layer or Residual Group Total Size Training using Adam
float32 490.94 MB 14.43 GB 57.72 GB
float16/bfloat16 245.47 MB 7.21 GB 28.86 GB
int8 122.73 MB 3.61 GB 14.43 GB
int4 61.37 MB 1.8 GB 7.21 GB

Running the model on CPU

Click to expand

import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration

processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-opt-2.7b")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt")

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True).strip())

Running the model on GPU

In full precision

Click to expand

# pip install accelerate
import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration

processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-opt-2.7b", device_map="auto")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt").to("cuda")

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True).strip())
In half precision (float16)

Click to expand

# pip install accelerate
import torch
import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration

processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-opt-2.7b", torch_dtype=torch.float16, device_map="auto")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt").to("cuda", torch.float16)

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True).strip())
In 8-bit precision (int8)

Click to expand

# pip install accelerate bitsandbytes
import torch
import requests
from PIL import Image
from transformers import Blip2Processor, Blip2ForConditionalGeneration

processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
model = Blip2ForConditionalGeneration.from_pretrained("Salesforce/blip2-opt-2.7b", load_in_8bit=True, device_map="auto")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

question = "how many dogs are in the picture?"
inputs = processor(raw_image, question, return_tensors="pt").to("cuda", torch.float16)

out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True).strip())

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:b3876013d29a6299cd6b213b3c7a66fcac937cf9&dn=Salesforce_blip2-opt-2.7b

Open magnet in torrent client · infohash b3876013d29a6299cd6b213b3c7a66fcac937cf9

Files & hashes

PathSizesha1sha256
README.md7.9 KB (8,118 B)c06dbf37b3ba97159c30bbb4887220d8ec924662441eced273ee86fe9ebb2eaaf269d3b2b665afecd180db6912977f3e32007dff
added_tokens.json23 B (23 B)7e810f1fd5597388bb7284bc025d0be3f978c6dabf278ed40222b5cb26b41f7a776034a85a48503238cda9cba490b384fce1a941
config.json1.0 KB (1,029 B)7ed472249e925c5d2ab5583c6eb414621796cc5e7faf83ff4e7c25e282dcc614d018205ebcb6e832164018339b40bfe70beffa6b
generation_config.json141 B (141 B)cc41d901f117bddfd66ca91a7b999bf9d094a6f668f63fe113bc1a113e277280a350aca9b2c4cfd16c82512a25996556903f4bed
merges.txt445.6 KB (456,318 B)226b0752cac7789c48f0cb3ec53eda48b7be36cc1ce1664773c50f3e0cc8842619a93edc4624525b728b188a9e0be33b7726adc5
model-00001-of-00002.safetensors9.31 GB (9,996,328,120 B)40b6847c82b203574f7d5f63cc657faa19039642b81228c9ac1b3dee1731ee71d51fe3b2c34f915019c44c25a793b51300ae24fc
model-00002-of-00002.safetensors4.64 GB (4,982,879,016 B)9604d0c99fdac0a6b622ec4bb830b618b3503a66536bd73b8f1de7d94f503b23fea2eaa4f7f3ea5f74f8f874fcb21d6df1555a19
model.safetensors.index.json118.8 KB (121,654 B)2d6fd6523bbe8e546a42f6b148dc778d2fb6e3531f2648af0e35c2d781c029503b9e49827850ae9174409a20ec252975ea1dd2b1
preprocessor_config.json432 B (432 B)0b0fa393c4e1fa80a41fd3b84e022c6e3488230e231d39b9cf3312f5ea2d82b6ea0a2da82cb5b1bd492ccb9feb7dde1303b2dfb5
processor_config.json68 B (68 B)881af9c00e0a6cee3fb9685aef961267a60d3f8b5d33768c38eb7d1963c10c78f2753f6de714ff96744217cf9b2647d83abd016a
pytorch_model-00001-of-00002.bin9.31 GB (9,996,239,804 B)fd5ff4944337cbe035595b084580613f07c709e783f4604e9f2c81dace48cbbb245cbe9acadddce7471c17eedc10cd675bf9af62
pytorch_model-00002-of-00002.bin5.12 GB (5,497,724,774 B)b8b7b0d4c523f971f97b626fef01c7679cdf2380b224ac0c148bf3aa0a211e5d043d38918ef57c2d3b714771a7c4b124129dbd48
pytorch_model.bin.index.json118.9 KB (121,727 B)10539203b28f48aa69807e2526c9257cac3f4d280d0300d2f9b0da4de6a955d3c0b8565f3473c01bcdf50f4705ae11866772aebd
special_tokens_map.json548 B (548 B)fd05f8e8b4a81d5d4987d20d7fd4258e73e5e51aedbf5e1520a90884935090c0cfb0e50e7c9c138906936d43bee1496f3af22094
tokenizer.json3.4 MB (3,558,841 B)7e61921f64b55e1ccb5a503277e0c87ac8d6e413677b7988b949e3f58c487cf72639bab6257fe350b9b8d984529ba1ab288ac58e
tokenizer_config.json882 B (882 B)902346b1f9e65e60946cf0d0d3fba4c6be43550794f138ffdd5c7a282b607267bfc04f60696507038981e48a239f3712fb9a5ec5
vocab.json779.6 KB (798,293 B)4ebe4bb3f3114daf2e4cc349f24873a1175a35d7ed19656ea1707df69134c4af35c8ceda2cc9860bf2c3495026153a133670ab5e

Cite this release

Canonical URL
https://aiseedbank.org/models/Salesforce_blip2-opt-2.7b/
Slug
Salesforce_blip2-opt-2.7b
Infohash
b3876013d29a6299cd6b213b3c7a66fcac937cf9
License
mit
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: Salesforce_blip2-opt-2.7b.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositorySalesforce/blip2-opt-2.7b
Revision (pinned)59a1ef6c1e5117b3f65523d1c6066825bcf315e3
Fetched at2026-09-03T20:26:13Z
License at fetchmit
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T20:30:46Z

mit28.39 GB (30,478,239,788 bytes)transformerspytorchsafetensorsblip-2visual-question-answeringvisionimage-to-textimage-captioningimage-text-to-textendpoints_compatible1 language (en)paper: 2301.12597