Skip to content
ModelListedExternal
Download

Open Clip

This is a ViT-B-32 model trained using OpenCLIP on the LAION-400M dataset.

KindOtherVersionRevision 2e9036c

Model source

Kind
Other
File size
1.69 GB
Version
vRevision 2e9036c
Updated
Sep 17, 2026
Downloads
0
Source
Hugging Face

Source description

ViT-B-32 OpenCLIP Model on LAION-400M

This is a ViT-B-32 model trained using OpenCLIP on the LAION-400M dataset.

Training Details

The model was trained with the following configuration:

  • Model Architecture: ViT-B-32
  • Dataset: LAION-400M
  • Number of Samples: 400M (~ 268,836,185 filtered samples used)
  • Hardware: 2 Nodes, each with 4 H200 141GB GPUs (Total 8 GPUs)
  • Batch Size (per GPU): 4096
  • Precision: amp_bfloat16
  • Total Epochs: 32
  • Warmup Steps: 2000

Additional specific performance-enhancing flags enabled during training: --torchcompile, --local-loss, and --gather-with-grad.

Evaluation

  • Eval Epoch: 0
  • imagenet-zeroshot-val-top1: 0.6086
  • imagenet-zeroshot-val-top5: 0.8632

Usage

import torch
import open_clip

# Load the model directly from huggingface
model, _, preprocess = open_clip.create_model_and_transforms('ViT-B-32', pretrained='hf-hub:lingkai/open-clip')

tokenizer = open_clip.get_tokenizer('ViT-B-32')

# Example inference
image = preprocess(Image.open("astronaut.png")).unsqueeze(0)
text = tokenizer(["a diagram", "a dog", "a cat"])

with torch.no_grad(), torch.cuda.amp.autocast():
    image_features = model.encode_image(image)
    text_features = model.encode_text(text)
    image_features /= image_features.norm(dim=-1, keepdim=True)
    text_features /= text_features.norm(dim=-1, keepdim=True)

    text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)

print("Label probs:", text_probs)

Sources

1 source
Hugging FacePrimaryVersion 2e9036cfbcd31635dd3b8ea83a825a708e2688a5
huggingface.co/lingkai/open-clip/tree/2e9036cfbcd31635dd3b8ea83a825a708e2688a5

Verified Sep 17

Model artifacts

8 artifacts

checkpoints/epoch_25.pt

pt · 1.69 GB · SHA-256 44fd948ffd4b…7e5b · Hugging Face

Download

checkpoints/epoch_26.pt

pt · 1.69 GB · SHA-256 9b908c778632…9b29 · Hugging Face

Download

checkpoints/epoch_27.pt

pt · 1.69 GB · SHA-256 8c5391b8c0b0…e619 · Hugging Face

Download

checkpoints/epoch_28.pt

pt · 1.69 GB · SHA-256 063b8dea65a2…fd98 · Hugging Face

Download

checkpoints/epoch_29.pt

pt · 1.69 GB · SHA-256 9511503638ae…2035 · Hugging Face

Download

checkpoints/epoch_30.pt

pt · 1.69 GB · SHA-256 3aefc59072fa…236a · Hugging Face

Download

checkpoints/epoch_31.pt

pt · 1.69 GB · SHA-256 c86249976545…e7c6 · Hugging Face

Download

checkpoints/epoch_32.pt

pt · 1.69 GB · SHA-256 ccc19a20a89a…ac88 · Hugging Face

Download

Source excerpts

2 excerpts

--- pipeline_tag: zero-shot-image-classification tags: - open_clip - clip - vision - image-text-retrieval - laion400m --- # ViT-B-32 OpenCLIP Model on LAION-400M This is a ViT-B-32 model trained using [OpenCLIP](https://github.com/mlfoundations/open_clip) on the LAION-400M dataset. ## Training Details The model was trained with the following configuration: - **Model Architecture**: ViT-B-32 - **Dataset**: LAION-400M - **Number of Samples**: 400M (~ 268,836,185 filtered samples used) - **Hardware**: 2 Nodes, each with 4 H200 141GB GPUs (Total 8 GPUs) - **Batch Size (per GPU)**: 4096 - **Precision**: `amp_bfloat16` - **Total Epochs**: 32 - **Warmup Steps**: 2000 Additional specific performance-enhancing flags enabled during training: `--torchcompile`, `--local-loss`, and `--gather-with-grad`. ## Evaluation - **Eval Epoch**: 0 - **imagenet-zeroshot-val-top1**: 0.6086 - **imagenet-zeroshot-val-top5**: 0.8632 ## Usage ```python import torch import open_clip # Load the model directly from huggingface model, _, preprocess = open_clip.create_model_and_transforms('ViT-B-32', pretrained='hf-hub:lingkai/open-clip') tokenizer = open_clip.get_tokenizer('ViT-B-32') # Example inference image = preprocess(Image.open("astronaut.png")).unsqueeze(0) text = tokenizer(["a diagram", "a dog", "a cat"]) with torch.no_grad(), torch.cuda.amp.autocast(): image_features = model.encode_image(image) text_features = model.encode_text(text) image_features /= image_features.norm(dim=-1, keepdim=True) text_features /= text_features.norm(dim=-1, keepdim=True) text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1) print("Label probs:", text_probs) ```

Source context: 0 downloads · 0 likes · Pipeline zero-shot-image-classification · Library open_clip · Repo lingkai/open-clip