code_execution_files / google_embeddinggemma-300m_3.txt
ariG23498's picture
ariG23498 HF Staff
Upload google_embeddinggemma-300m_3.txt with huggingface_hub
976d949 verified
raw
history blame
472 Bytes
```CODE:
words = ["apple", "banana", "car"]
# Calculate embeddings by calling model.encode()
embeddings = model.encode(words)
print(embeddings)
for idx, embedding in enumerate(embeddings):
print(f"Embedding {idx+1} (shape): {embedding.shape}")
```
ERROR:
Traceback (most recent call last):
File "/tmp/google_embeddinggemma-300m_3m779bD.py", line 17, in <module>
embeddings = model.encode(words)
^^^^^
NameError: name 'model' is not defined