pypi open-clip-torch 4.2.1
v4.2.1

6 hours ago

The first 4.x release on PyPI, and it adds official pretrained NaFlex CLAP audio-text models. It also moves training to
a new stack and adds several model families. Earlier 4.x version numbers were development versions only.

Pretrained image-text inference is intended to remain compatible, but training scripts and downstream integrations need review. See the migration guide. To stay on 3.x, run pip install 'open_clip_torch<4'.

Highlights

  • NaFlex CLAP: five Apache 2.0 audio-text models (27M to 340M parameters) that take variable-length audio, trained on LAION-Audio-XL: XXS, XS, S, M, L
  • NaFlex CLIP: variable-resolution and variable-aspect image towers with token-budget batching
  • NaFlex GenLIP / GenLAP: generative image and audio captioning with prefix-LM attention (training configs, no pretrained weights yet)
  • Modern text towers: RoPE, SwiGLU/ReLU², and RMSNorm options, per-batch variable-length text, and Hugging Face ModernBERT towers
  • MaMMUT and CoCa v2: MaMMUT with the released LAION weights, plus corrected coca2_* configs
  • Training stack: TrainingTask wrappers, dict-based batches, FSDP2 (--fsdp), torch.compile strategies, and length bucketing
  • Safer checkpoint loading: all checkpoint loads use weights_only=True, and OpenAI weights now load from the Hugging Face Hub
    instead of JIT archives

Upgrade notes

  • PyPI now requires torch>=2.6 (was >=2.0)
  • The default --precision is now amp_bf16 (was amp), and SigLIP's --loss-dist-impl now defaults to gather
  • --horovod, --torchscript, and --trace are removed
  • load_openai_model, list_openai_models, build_model_from_openai_state_dict, and trace_model are removed; use
    create_model_from_pretrained(..., pretrained='openai') for OpenAI weights
  • Dataloaders now emit dict batches, and training code should pass a TrainingTask instead of a separate model and loss
  • python -m open_clip_train.legacy_main remains available as a compatibility path for older image-text training scripts

See the migration guide for the full list of changes.

What's Changed

New Contributors

Full Changelog: v3.3.0...v4.2.1

Don't miss a new open-clip-torch release

NewReleases is sending notifications on new releases.