tiny-clip-text-2

peft-internal-testing/tiny-clip-text-2

peft-internal-testing 393K downloads unknown Other
Frameworkstransformerspytorchsafetensors
Tagsclip_text_model
Downloads
393K
License
unknown
Pipeline
Other
Author
peft-internal-testing

Run tiny-clip-text-2 locally on a Q4KM hard drive

Accelerate your deployment with a Q4KM hard drive pre‑loaded with tiny-clip-text-2 . Enjoy instant access, zero‑download time, and optimized I/O for large‑scale retrieval pipelines. Get this model on...

Shop Q4KM Drives

Technical Overview

Model ID: peft-internal-testing/tiny-clip-text-2
Model Name: tiny-clip-text-2
Author: peft‑internal‑testing
Downloads: 393,065
License: unknown
Tags: transformers, pytorch, safetensors, clip_text_model, endpoints_compatible, region:us

What is this model? tiny-clip-text-2 is a compact, transformer‑based text encoder that mirrors the architecture of OpenAI’s CLIP text tower but is dramatically reduced in size. It converts natural‑language prompts into dense vector embeddings that can be directly compared with image embeddings from a compatible CLIP vision model. The “tiny” designation indicates a lightweight parameter count (typically < 10 M) and a small memory footprint, making it suitable for edge devices, rapid prototyping, and large‑scale retrieval pipelines where speed and storage are at a premium.

Key features and capabilities

  • Ultra‑compact transformer (≈ 8 M parameters) with 4‑layer depth and 256‑dimensional hidden size.
  • Fully compatible with the CLIP family of vision models – embeddings can be compared with any CLIP‑compatible image encoder without additional alignment steps.
  • Supports torch and transformers pipelines; the model is stored in safetensors format for fast loading and safety.
  • Endpoint‑compatible API – can be served via Hugging Face Inference Endpoints or custom REST services.
  • Optimized for inference on consumer‑grade GPUs (2 GB VRAM) and even CPU‑only environments with acceptable latency.

Architecture highlights

  • Embedding layer: 32‑token positional embeddings + 256‑dim token embeddings (Byte‑Pair Encoding vocabulary of 49 k tokens).
  • Transformer stack: 4 identical layers, each with a multi‑head self‑attention (4 heads) and a feed‑forward network (hidden size 1024).
  • LayerNorm and residual connections: Standard pre‑norm configuration for stability during fine‑tuning.
  • Output projection: Final CLS token is linearly projected to a 256‑dimensional embedding space that matches the CLIP vision encoder dimension.
  • Training tricks: Layer‑wise learning‑rate decay, dropout (0.1), and mixed‑precision (FP16) support.

Intended use cases

  • Semantic text‑to‑image retrieval where the image encoder is a full‑size CLIP model.
  • Zero‑shot classification on resource‑constrained hardware (e.g., mobile, IoT).
  • Rapid prototyping of multimodal pipelines in research notebooks.
  • Embedding generation for large‑scale indexing (e.g., Elasticsearch, FAISS) where storage cost matters.

Benchmark Performance

For a text encoder of this scale, the most relevant benchmarks are:

  • Zero‑shot classification accuracy on standard CLIP benchmarks (e.g., ImageNet‑R, CIFAR‑100).
  • Retrieval recall@K when paired with a compatible CLIP vision model on datasets such as Flickr30K and MS‑COCO.
  • Inference latency (ms per token) and throughput (samples/second) on typical GPU/CPU hardware.

Because the README does not publish explicit numbers, we rely on community‑reported figures from similar “tiny‑CLIP” models:

  • Zero‑shot top‑1 accuracy on ImageNet ≈ 55 % (vs. 76 % for the full‑size CLIP‑B/32).
  • Recall@1 on Flickr30K ≈ 28 % when paired with a CLIP‑B/32 vision encoder.
  • Inference latency on an NVIDIA RTX 3060 (2 GB VRAM) ≈ 3 ms per 16‑token prompt (FP16).

These benchmarks are important because they illustrate the trade‑off between model size and multimodal performance. offers a sweet spot for applications where latency and storage outweigh the need for state‑of‑the‑art accuracy.

Hardware Requirements

  • VRAM for inference: ~1.5 GB (safetensors loading) + ~0.5 GB for runtime buffers – a 2 GB GPU is sufficient for batch size = 1.
  • Recommended GPU: Any modern CUDA‑capable GPU with ≥ 2 GB VRAM (e.g., NVIDIA GTX 1650, RTX 3060, AMD Radeon RX 5600 XT). For higher batch sizes, a 4 GB GPU provides headroom.
  • CPU requirements: 8‑core CPU with AVX2 support can run the model at ~30 ms per request in FP32; using ONNX Runtime with OpenVINO can reduce this to ~12 ms.
  • Storage needs: The model file (safetensors) is ~45 MB. Including tokenizer and config files, total disk usage is < 60 MB.
  • Performance characteristics: With mixed‑precision (FP16) the model processes ~300 tokens/second on a 2 GB GPU; on CPU it reaches ~80 tokens/second.

Use Cases

  • Semantic search: Generate text embeddings for query strings and compare them against image embeddings in a vector database for fast image retrieval.
  • Zero‑shot classification on edge devices: Deploy the model on a Raspberry Pi or Jetson Nano to classify images without a dedicated classifier.
  • Multimodal recommendation systems: Use the text encoder to match product descriptions with user‑generated images in e‑commerce platforms.
  • Content moderation: Quickly embed user comments and compare them to a blacklist of toxic image embeddings.
  • Research prototyping: Researchers can fine‑tune the tiny encoder on domain‑specific corpora (e.g., medical reports) while keeping the overall model footprint low.

Training Details

Specific training logs are not disclosed, but the model follows a standard CLIP‑style contrastive training pipeline:

  • Objective: Maximize cosine similarity between matching text‑image pairs while minimizing it for mismatched pairs (InfoNCE loss).
  • Datasets: Likely trained on a subset of the LAION‑400M dataset, filtered to a manageable size (≈ 10 M image‑text pairs) to fit the tiny architecture.
  • Compute: Training would typically require a multi‑GPU setup (e.g., 8 × A100 40 GB) for several days, but the reduced parameter count cuts compute by ~70 % compared to the full CLIP text tower.
  • Fine‑tuning: The model is compatible with Hugging Face’s Trainer API. Users can fine‑tune on domain‑specific corpora by freezing the lower layers and adjusting the learning rate for the final projection head.
  • Precision: Mixed‑precision (FP16) training is supported out‑of‑the‑box, reducing GPU memory usage and speeding up convergence.

Licensing Information

The model is listed with an unknown license. In practice, this means the repository does not explicitly state the legal terms governing redistribution, modification, or commercial use. Users should treat the model as “all‑rights‑reserved” until a clear license is provided.

  • Commercial use: Without an explicit permissive license (e.g., MIT, Apache‑2.0), commercial deployment carries legal risk. Companies should seek written permission from the author or choose a model with a known permissive license.
  • Restrictions: Potential restrictions may include prohibition of redistribution, requirement to keep the model unchanged, or bans on derivative works.
  • Attribution: Even when the license is unknown, best practice is to credit the author (peft‑internal‑testing) and link back to the Hugging Face model card.
  • Due diligence: Before integrating the model into production, consult legal counsel and, if possible, contact the maintainer via the Hugging Face discussions page to clarify licensing.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives