Tom Aarsen
commited on
Commit
•
8411d8e
1
Parent(s):
af02f33
Add Sentence Transformers usage snippet
Browse files
README.md
CHANGED
@@ -2653,6 +2653,17 @@ Training data to train the models is released in its entirety. For more details,
|
|
2653 |
|
2654 |
## Usage
|
2655 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2656 |
|
2657 |
```python
|
2658 |
import torch
|
|
|
2653 |
|
2654 |
## Usage
|
2655 |
|
2656 |
+
### Sentence Transformers
|
2657 |
+
```python
|
2658 |
+
from sentence_transformers import SentenceTransformer
|
2659 |
+
|
2660 |
+
model = SentenceTransformer("nomic-ai/nomic-embed-text-v1-ablated", trust_remote_code=True)
|
2661 |
+
sentences = ['What is TSNE?', 'Who is Laurens van der Maaten?']
|
2662 |
+
embeddings = model.encode(sentences)
|
2663 |
+
print(embeddings)
|
2664 |
+
```
|
2665 |
+
|
2666 |
+
### Transformers
|
2667 |
|
2668 |
```python
|
2669 |
import torch
|