ariG23498 HF Staff commited on
Commit
f4bd020
·
verified ·
1 Parent(s): ea4d20d

Upload BAAI_bge-m3_0.txt with huggingface_hub

Browse files
Files changed (1) hide show
  1. BAAI_bge-m3_0.txt +23 -0
BAAI_bge-m3_0.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```CODE:
2
+ from sentence_transformers import SentenceTransformer
3
+
4
+ model = SentenceTransformer("BAAI/bge-m3")
5
+
6
+ sentences = [
7
+ "That is a happy person",
8
+ "That is a happy dog",
9
+ "That is a very happy person",
10
+ "Today is a sunny day"
11
+ ]
12
+ embeddings = model.encode(sentences)
13
+
14
+ similarities = model.similarity(embeddings, embeddings)
15
+ print(similarities.shape)
16
+ # [4, 4]
17
+ ```
18
+
19
+ ERROR:
20
+ Traceback (most recent call last):
21
+ File "/tmp/BAAI_bge-m3_0C20eDG.py", line 14, in <module>
22
+ from sentence_transformers import SentenceTransformer
23
+ ModuleNotFoundError: No module named 'sentence_transformers'