Downloads · 30 days
20
8% of all-time downloads
sugiv/octopus-omni-embed
octopus-omni-embed is a feature extraction model from sugiv. Use it when you need embeddings to search or compare text. It is set up for transformers. The card lists the license as apache-2.0.
A cost-efficient multi-modal embedding model that encodes Text, Images, and Video into a common 2048-dimensional latent space. Built on Qwen2.5-Omni-3B Thinker architecture and trained for $25 with purposefully limite…
Downloads · 30 days
20
8% of all-time downloads
All-time downloads
260
Public
Parameters
5.5B
11.1 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors11.1 GB · 100%
How the weights are stored.
BF165.5B · 100%
From the Hugging Face model README
A cost-efficient multi-modal embedding model that encodes Text, Images, and Video into a common 2048-dimensional latent space. Built on Qwen2.5-Omni-3B Thinker architecture and trained for $25 with purposefully limited data for educational demonstration.
🎯 Project Goal: Demonstrate that you can build a functional multi-modal embedding model on a hobby budget (<$50) with limited data (110K samples), not to compete with SOTA models or achieve leaderboard rankings. This is an educational project showing the training process, not a production research model.
Successfully encodes 3 modalities in common latent space:
Cross-Modal Similarities:
Unlike the full Qwen2.5-Omni model (Thinker + Talker):
This Thinker-only design follows NVIDIA's Omni-Embed approach - we leverage the pre-trained multi-modal understanding capabilities while excluding speech generation components unnecessary for embedding tasks.
Why Thinker-Only?
q_proj, v_proj, k_proj, o_proj (language model only)Why Limited Data? This project intentionally uses a small dataset (110K samples) to demonstrate:
Not trying to:
Stage 1: Text-Text Embedding Foundation
Stage 2: Cross-Modal Text-Image Alignment
Total Training:
# Stage 1 & 2 shared config
optimizer: AdamW
learning_rate: 1e-5 (Stage 2), 2e-5 (Stage 1)
weight_decay: 0.01
batch_size: 8
gradient_accumulation_steps: 2
lora_rank: 16
lora_alpha: 32
lora_dropout: 0.05
target_modules: ["q_proj", "v_proj", "k_proj", "o_proj"]
max_seq_length: 512
# Frozen components
vision_encoder: frozen (from Qwen2.5-Omni)
video_encoder: frozen (from Qwen2.5-Omni)
audio_encoder: frozen (from Qwen2.5-Omni)
Loss converged to 0.0137 (98% reduction from start), indicating the model learned the text-image alignment efficiently. Training longer risked overfitting on our purposefully small dataset.
Note: Model excels at cross-modal (text-image) retrieval as designed. Text-text performance is low, likely due to:
We ARE NOT competing with:
What we achieved:
torch.Tensor[batch_size, 2048]import torch
import sys
sys.path.append('src') # If needed for custom model code
from model.omni_embed_model import OmniEmbedModel
from PIL import Image
# Load model from HuggingFace
model = OmniEmbedModel.from_pretrained('sugiv/octopus-omni-embed')
model.to('cuda').eval()
processor = model.processor
# 1. Encode TEXT
text_inputs = processor(
text=['passage: A person walking in the park'],
return_tensors='pt',
padding=True
)
text_inputs = {k: v.to('cuda') for k, v in text_inputs.items()}
with torch.no_grad():
text_emb = model(**text_inputs)
print(f"Text embedding: {text_emb.shape}") # [1, 2048], norm=1.0
# 2. Encode IMAGE
image = Image.open('document.jpg')
image_inputs = processor(
images=[image],
text=[''], # Empty text for pure image embedding
return_tensors='pt',
padding=True
)
image_inputs = {k: v.to('cuda') for k, v in image_inputs.items()}
with torch.no_grad():
image_emb = model(**image_inputs)
print(f"Image embedding: {image_emb.shape}") # [1, 2048], norm=1.0
# 3. Encode VIDEO (8 frames)
video_frames = [Image.open(f'frame_{i}.jpg') for i in range(8)]
video_inputs = processor(
videos=[video_frames],
text=['describe this video'],
return_tensors='pt',
padding=True,
use_audio_in_video=False
)
video_inputs = {k: v.to('cuda') for k, v in video_inputs.items()}
with torch.no_grad():
video_emb = model(**video_inputs)
print(f"Video embedding: {video_emb.shape}") # [1, 2048], norm=1.0
# 4. Compute Cross-Modal Similarity
similarity = torch.nn.functional.cosine_similarity(text_emb, image_emb, dim=-1)
print(f"Text-Image similarity: {similarity.item():.4f}")
The octopus is known for:
Just like this model processes text, images, and video in a unified embedding space while working within budget constraints!
# Required packages
pip install torch transformers pillow
# Optional: For video processing
pip install qwen-omni-utils
Minimum (Inference):
Recommended (Inference):
If you use this model or find the training methodology helpful:
@misc{octopus-omni-embed-2025,
title={Octopus-Omni-Embed: Cost-Efficient Multi-Modal Embedding Model},
author={Sugi Valluri},
year={2025},
url={https://huggingface.co/sugiv/octopus-omni-embed},
note={Educational project demonstrating multi-modal training on $25 budget}
}
Apache 2.0 (inherited from base Qwen2.5-Omni-3B model)
Version: 1.0 (Stage 2, Epoch 2)
Release Date: October 29, 2025
Training Cost: $25.00
Training Samples: 110,000
Built with ❤️ and limited resources to show that anyone can train multi-modal models!