Feature Extraction
sentence-transformers
Safetensors
Transformers
codexembed2b
code
retrieval
custom_code
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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Salesforce/SFR-Embedding-Code-2B_R", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,7 +12,7 @@ Check out our [paper](https://arxiv.org/abs/2411.12644) for more details!
|
|
| 12 |
We also offer 400M-size model [Salesforce/SFR-Embedding-Code-400_R](https://huggingface.co/Salesforce/SFR-Embedding-Code-400M_R)
|
| 13 |
|
| 14 |
### Ethical Considerations
|
| 15 |
-
This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people’s lives, rights, or safety. For further guidance on use cases, refer to our AUP and AI AUP.
|
| 16 |
|
| 17 |
### License Statement:
|
| 18 |
Users need to make their own assessment regarding any obligations or responsibilities under the corresponding licenses or terms and conditions pertaining to the original datasets and data. This release is for research purposes only in support of an academic paper.
|
|
|
|
| 12 |
We also offer 400M-size model [Salesforce/SFR-Embedding-Code-400_R](https://huggingface.co/Salesforce/SFR-Embedding-Code-400M_R)
|
| 13 |
|
| 14 |
### Ethical Considerations
|
| 15 |
+
This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people’s lives, rights, or safety. For further guidance on use cases, refer to our [AUP](https://www.salesforce.com/content/dam/web/en_us/www/documents/legal/Agreements/policies/ExternalFacing_Services_Policy.pdf) and [AI AUP](https://www.salesforce.com/content/dam/web/en_us/www/documents/legal/Agreements/policies/ai-acceptable-use-policy.pdf).
|
| 16 |
|
| 17 |
### License Statement:
|
| 18 |
Users need to make their own assessment regarding any obligations or responsibilities under the corresponding licenses or terms and conditions pertaining to the original datasets and data. This release is for research purposes only in support of an academic paper.
|