Sentence Similarity
sentence-transformers
PyTorch
Safetensors
Transformers
Russian
bert
pretraining
russian
fill-mask
embeddings
masked-lm
tiny
feature-extraction
text-embeddings-inference
Instructions to use cointegrated/rubert-tiny2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cointegrated/rubert-tiny2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cointegrated/rubert-tiny2") 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] - Transformers
How to use cointegrated/rubert-tiny2 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForPreTraining tokenizer = AutoTokenizer.from_pretrained("cointegrated/rubert-tiny2") model = AutoModelForPreTraining.from_pretrained("cointegrated/rubert-tiny2") - Inference
- Notebooks
- Google Colab
- Kaggle
If someone struggling to run rubert-tiny2 with vLLM
#5
by WpythonW - opened
Environment (tested on Google Colab T4):
vLLM: 0.11.2
Transformers: 4.57.2
Safetensors: 0.7.0
PyTorch: 2.9.0+cu126
CUDA: 12.6
Modifications:
- Changed architecture from
BertForPreTrainingtoBertModelin config.json - Fused separate Q/K/V weights into
qkv_projformat (vLLM's fused attention optimization) - Removed pretraining heads (MLM/NSP) and pooler weights
- Stripped
bert.prefix from weight keys (vLLM addsmodel.automatically via mapper)
Full conversion notebook: https://colab.research.google.com/drive/1SS9qEayvwZU1r1khxq9tWf7iEZcxw2yW?usp=sharing
Thanks a lot, Andrew!
If you upload the converted model separately to HF, I would be happy to share the link to it in the rubert-tiny2 model card!
Hi! The vLLM-optimized version is now ready: https://huggingface.co/WpythonW/rubert-tiny2-vllm
Feel free to link it in the rubert-tiny2 card!
Done :)
cointegrated changed discussion status to closed