Update README.md
Browse filesfix sentence-transformer support
README.md
CHANGED
|
@@ -76,14 +76,18 @@ print(f"Similarity: {similarity.item():.4f}")
|
|
| 76 |
from sentence_transformers import SentenceTransformer
|
| 77 |
from sentence_transformers.util import cos_sim
|
| 78 |
|
| 79 |
-
model
|
|
|
|
| 80 |
|
|
|
|
| 81 |
sentences = ["This is an example sentence", "Each sentence is converted to a vector"]
|
| 82 |
embeddings = model.encode(sentences)
|
| 83 |
|
|
|
|
|
|
|
| 84 |
# Compute similarity
|
| 85 |
-
similarity = cos_sim(embeddings, embeddings)
|
| 86 |
-
print(f"Similarity: {similarity.item():.4f}")
|
| 87 |
```
|
| 88 |
|
| 89 |
======================================================================
|
|
|
|
| 76 |
from sentence_transformers import SentenceTransformer
|
| 77 |
from sentence_transformers.util import cos_sim
|
| 78 |
|
| 79 |
+
# Load your model (should work now!)
|
| 80 |
+
model = SentenceTransformer("dmedhi/PawanEmbd-68M")
|
| 81 |
|
| 82 |
+
# Test encoding
|
| 83 |
sentences = ["This is an example sentence", "Each sentence is converted to a vector"]
|
| 84 |
embeddings = model.encode(sentences)
|
| 85 |
|
| 86 |
+
print(f"✅ Embeddings shape: {embeddings.shape}")
|
| 87 |
+
|
| 88 |
# Compute similarity
|
| 89 |
+
similarity = cos_sim(embeddings[0], embeddings[1])
|
| 90 |
+
print(f"✅ Similarity: {similarity.item():.4f}")
|
| 91 |
```
|
| 92 |
|
| 93 |
======================================================================
|