Skip to main content

pytorch-zero-lit

Converted official JAX models for LiT: Zero-Shot Transfer with Locked-image text Tuning to pytorch.

JAX -> Tensorflow -> ONNX -> Pytorch.

  • Image encoder is loaded into pytorch and supports gradients
  • Text encoder is not loaded into pytorch and runs via ONNX on cpu

Install

poetry add pytorch-zero-lit

or

pip install pytorch-zero-lit

Usage

from lit import LiT

model = LiT()

images = TF.to_tensor(
    Image.open("cat.png").convert("RGB").resize((224, 224))
)[None]
texts = [
    "a photo of a cat",
    "a photo of a dog",
    "a photo of a bird",
    "a photo of a fish",
]

image_encodings = model.encode_images(images)
text_encodings = model.encode_texts(texts)

cosine_similarity = model.cosine_similarity(image_encodings, text_encodings)

Metadata

Release files for pytorch-zero-lit 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytorch-zero-lit 0.2.3
File Size Uploaded Provenance Actions
pytorch-zero-lit-0.2.3.tar.gz 4.1 kB Without provenance Details for pytorch-zero-lit-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pytorch-zero-lit 0.2.3
File Interpreter ABI Platform Actions
pytorch_zero_lit-0.2.3-py3-none-any.whl Python 3 none any Details for pytorch_zero_lit-0.2.3-py3-none-any.whl

Total release size: 8.1 kB

Release files / pytorch-zero-lit-0.2.3.tar.gz

Download URL pytorch-zero-lit-0.2.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fae3fe704a1ae31d911ba89977523085f2d66bd309b037d1d0b2e7406337cf7a
BLAKE2b-256 checksum
How to use checksums
7a5f64443acd04ef801115ca0b5e3a4a37883239ee0ae19ce5afd0ebdb8047ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.8 Linux/5.15.0-48-generic

Release files / pytorch_zero_lit-0.2.3-py3-none-any.whl

Download URL pytorch_zero_lit-0.2.3-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eefa460f4e6ff0053c9ab308cfbe4ff442f9ecc718cdd02eefecfe7dfb1b416e
BLAKE2b-256 checksum
How to use checksums
5a630c8319ca80537e862dd335663af05213977b8465bc16e2f8111e4901abbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.8 Linux/5.15.0-48-generic

Security for pytorch-zero-lit 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page