Create translate
#29
by
byour
- opened
translate
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sentence_transformers import SentenceTransformer
|
2 |
+
|
3 |
+
model = SentenceTransformer("jinaai/jina-clip-v2", trust_remote_code=True)
|
4 |
+
|
5 |
+
sentences = [
|
6 |
+
"The weather is lovely today.",
|
7 |
+
"It's so sunny outside!",
|
8 |
+
"He drove to the stadium."
|
9 |
+
]
|
10 |
+
embeddings = model.encode(sentences)
|
11 |
+
|
12 |
+
similarities = model.similarity(embeddings, embeddings)
|
13 |
+
print(similarities.shape)
|
14 |
+
# [3, 3]
|