Instructions to use ewin-reg/WeMM-Embedding-2B-Quantized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ewin-reg/WeMM-Embedding-2B-Quantized with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ewin-reg/WeMM-Embedding-2B-Quantized", trust_remote_code=True) sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Apache-2.0 License?
Hi!
Would the license same as the original model by Tencent, Apache-2.0? Please help clarify, thanks!
Yah
Great! Many thanks for your quick reply and effort!
Ur welcome
Hi @WC-ECL , glad the smaller checkpoint held up well.
I checked modeling_wemm_embedding.py. The INT4 W4A8 layers just unpack uint8 bits and call F.linear, nothing CUDA-specific, so those should run fine on MPS.
The FP8 modules are the real risk: the vocab embedding table and the 6 full-attention layers store weights as torch.float8_e4m3fn and dequantize by indexing into that tensor then casting to float32. MPS float8 support varies by PyTorch version. That's where this breaks if it breaks.
Test it first:
import torch
x = torch.zeros(4, 4, dtype=torch.float8_e4m3fn, device="mps")
print(x.to(torch.float32))
If that throws, you've found the wall. If it works, nothing else in the model is CUDA-locked, so device="mps" should carry through fine. Post your PyTorch version once you know, it'll help anyone else hitting this.
@WC-ECL , hope it goes well! You should check out our more light weight quantized model that's from jina embeddings small omni retrieval!
https://huggingface.co/ewin-reg/WeMM-Embedding-2B-Quantized