Feature Extraction
sentence-transformers
ONNX
Safetensors
Transformers
new
image-feature-extraction
code
retrieval
custom_code
text-embeddings-inference
Instructions to use Salesforce/SFR-Embedding-Code-400M_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-400M_R with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Salesforce/SFR-Embedding-Code-400M_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-400M_R with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Salesforce/SFR-Embedding-Code-400M_R", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Salesforce/SFR-Embedding-Code-400M_R", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Add pipeline tag, library name and link to paper
#2
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
<h1 align="center">Salesforce/SFR-Embedding-Code-400M_R</h1>
|
| 5 |
|
|
@@ -7,7 +9,7 @@ license: cc-by-nc-4.0
|
|
| 7 |
|
| 8 |
The Salesforce/SFR-Embedding-Code is a generalist embedding model family for multilingual and multi-task code and Text retrieval. It demonstrates superior performance compared to various open-source code embedding models across multiple code retrieval tasks.
|
| 9 |
|
| 10 |
-
Check out our [paper](https://
|
| 11 |
|
| 12 |
### Ethical Considerations
|
| 13 |
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).
|
|
@@ -91,5 +93,4 @@ print(cos_sim(embeddings[0], embeddings[1:]))
|
|
| 91 |
journal={arXiv preprint arXiv:2411.12644},
|
| 92 |
year={2024}
|
| 93 |
}
|
| 94 |
-
```
|
| 95 |
-
|
|
|
|
| 1 |
---
|
| 2 |
license: cc-by-nc-4.0
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: feature-extraction
|
| 5 |
---
|
| 6 |
<h1 align="center">Salesforce/SFR-Embedding-Code-400M_R</h1>
|
| 7 |
|
|
|
|
| 9 |
|
| 10 |
The Salesforce/SFR-Embedding-Code is a generalist embedding model family for multilingual and multi-task code and Text retrieval. It demonstrates superior performance compared to various open-source code embedding models across multiple code retrieval tasks.
|
| 11 |
|
| 12 |
+
Check out our [paper](https://huggingface.co/papers/2411.12644) for more details!
|
| 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).
|
|
|
|
| 93 |
journal={arXiv preprint arXiv:2411.12644},
|
| 94 |
year={2024}
|
| 95 |
}
|
| 96 |
+
```
|
|
|