code_execution_files / nvidia_llama-embed-nemotron-8b_0.txt
ariG23498's picture
ariG23498 HF Staff
Upload nvidia_llama-embed-nemotron-8b_0.txt with huggingface_hub
5a21b25 verified
raw
history blame
639 Bytes
```CODE:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("nvidia/llama-embed-nemotron-8b", 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]
```
ERROR:
Traceback (most recent call last):
File "/tmp/nvidia_llama-embed-nemotron-8b_05e9I7M.py", line 14, in <module>
from sentence_transformers import SentenceTransformer
ModuleNotFoundError: No module named 'sentence_transformers'