Feature Extraction
Transformers
Safetensors
Chinese
English
tianmu_emb_uni_adapter_prototype
multimodal
embedding
retrieval
audio
video
image
text
visdoc
qwen3-vl
mmeb-v3
Instructions to use TianmuLab/Tianmu-Emb-Uni with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TianmuLab/Tianmu-Emb-Uni with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="TianmuLab/Tianmu-Emb-Uni")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TianmuLab/Tianmu-Emb-Uni", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 1,181 Bytes
ea416d9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #!/usr/bin/env python3
"""Minimal checkpoint loading example for Tianmu-Emb-Uni-8B adapter weights.
This repository releases trained adapter/audio-side weights. Base model weights
for Qwen3-VL-Embedding-8B and Qwen2.5-Omni-7B must be available separately.
"""
from pathlib import Path
import sys
import torch
from safetensors.torch import load_file
def main():
repo_dir = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(repo_dir))
from tianmu_model.modeling import OmniEmbedModel
weight_path = repo_dir / "model.safetensors"
model = OmniEmbedModel(
audio_encoder_type="omni",
audio_model_path="/path/to/Qwen2.5-Omni-7B",
vl_model_name="/path/to/Qwen3-VL-Embedding-8B",
freeze_vl=True,
freeze_audio_encoder=True,
)
state_dict = load_file(str(weight_path), device="cpu")
missing, unexpected = model.load_state_dict(state_dict, strict=False)
print(f"loaded tensors: {len(state_dict)}")
print(f"missing keys: {len(missing)}")
print(f"unexpected keys: {len(unexpected)}")
model.eval()
with torch.no_grad():
print("model ready")
if __name__ == "__main__":
main()
|