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