Feature Extraction
sentence-transformers
Safetensors
Transformers
codexembed2b
code
retrieval
custom_code
Run this model with HF Jobs
Run Salesforce/SFR-Embedding-Code-2B_R 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/Salesforce/SFR-Embedding-Code-2B_R. 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/Salesforce/SFR-Embedding-Code-2B_R 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 Salesforce/SFR-Embedding-Code-2B_R with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Salesforce/SFR-Embedding-Code-2B_R with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Salesforce/SFR-Embedding-Code-2B_R", 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] - Transformers
How to use Salesforce/SFR-Embedding-Code-2B_R with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Salesforce/SFR-Embedding-Code-2B_R", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Salesforce/SFR-Embedding-Code-2B_R", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download tokenizer.model from Salesforce/SFR-Embedding-Code-2B_R: direct link, hf CLI and curl.
- Browser
- Download file 4.24 MB
-
https://huggingface.co/Salesforce/SFR-Embedding-Code-2B_R/resolve/refs%2Fpr%2F7/tokenizer.model
- Command line
-
hf download hf://Salesforce/SFR-Embedding-Code-2B_R@refs/pr/7/tokenizer.model
-
curl -L -o tokenizer.model https://huggingface.co/Salesforce/SFR-Embedding-Code-2B_R/resolve/refs%2Fpr%2F7/tokenizer.model
4.24 MB
- Xet hash:
- fde8653f2f656fb4ab30c2a5db64ba86a916a86134355b76c3bf26a5b022b323
- Size of remote file:
- 4.24 MB
- SHA256:
- 61a7b147390c64585d6c3543dd6fc636906c9af3865a5548f27f31aee1d4c8e2
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.