Sentence Similarity
sentence-transformers
ONNX
Safetensors
OpenVINO
modernbert
feature-extraction
Generated from Trainer
dataset_size:36864
loss:MatryoshkaLoss
loss:CachedMultipleNegativesRankingLoss
text-embeddings-inference
Run this model with HF Jobs
Run redis/langcache-embed-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/redis/langcache-embed-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/redis/langcache-embed-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use redis/langcache-embed-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use redis/langcache-embed-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("redis/langcache-embed-v2") sentences = [ "What are civil cases and what are some examples?", "What are criminal cases and what are no examples?", "Civil cases involve disputes between individuals or organizations, typically seeking monetary compensation or specific performance, and *do not* include criminal prosecutions by the government.", "Criminal cases involve disputes between individuals or organizations, seeking monetary damages or specific performance, while civil cases concern offenses against the state punishable by imprisonment.", "What are some examples of civil cases?" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [5, 5] - Inference
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files371 unmodified lines3723733743753763777 unmodified lines3853863873883893903915 unmodified lines397398399400401402403371 unmodified lines### BibTeX#### Sentence Transformers```bibtex@inproceedings{reimers-2019-sentence-bert,7 unmodified lines}```#### MatryoshkaLoss```bibtex@misc{kusupati2024matryoshka,title={Matryoshka Representation Learning},5 unmodified lines}```#### CachedMultipleNegativesRankingLoss```bibtex@misc{gao2021scaling,title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},371 unmodified lines3723733743753763773783793803813823833843853863873883893907 unmodified lines3983994004014024034045 unmodified lines410411412413414415416371 unmodified lines### BibTeX#### Redis Langcache-embed Models]```bibtex@inproceedings{langcache-embed-v1,title = "Advancing Semantic Caching for LLMs with Domain-Specific Embeddings and Synthetic Data",author = "Gill, Cechmanek, Hutcherson, Rajamohan, Agarwal, Gulzar, Singh, Dion",month = "04",year = "2025",url = "https://arxiv.org/abs/2504.02268",}```#### Sentence Transformers```bibtex@inproceedings{reimers-2019-sentence-bert,7 unmodified lines}``````bibtex@misc{kusupati2024matryoshka,title={Matryoshka Representation Learning},5 unmodified lines}``````bibtex@misc{gao2021scaling,title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
README.md+15-2