Upload google_embeddinggemma-300m_9.txt with huggingface_hub
Browse files
google_embeddinggemma-300m_9.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
```CODE:
|
| 2 |
+
model = SentenceTransformer(model_id, truncate_dim=256, similarity_fn_name="dot").to(device=device)
|
| 3 |
+
embeddings = model.encode(words, prompt_name="STS", normalize_embeddings=True)
|
| 4 |
+
|
| 5 |
+
for idx, embedding in enumerate(embeddings):
|
| 6 |
+
print(f"Embedding {idx+1}: {embedding.shape}")
|
| 7 |
+
|
| 8 |
+
print("-"*80)
|
| 9 |
+
check_word_similarities()
|
| 10 |
+
```
|
| 11 |
+
|
| 12 |
+
ERROR:
|
| 13 |
+
Traceback (most recent call last):
|
| 14 |
+
File "/tmp/google_embeddinggemma-300m_9z2RUao.py", line 14, in <module>
|
| 15 |
+
model = SentenceTransformer(model_id, truncate_dim=256, similarity_fn_name="dot").to(device=device)
|
| 16 |
+
^^^^^^^^^^^^^^^^^^^
|
| 17 |
+
NameError: name 'SentenceTransformer' is not defined
|