Chrislu commited on
Commit
a24f520
1 Parent(s): fad5ae1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +6 -8
README.md CHANGED
@@ -60,19 +60,17 @@ Chuxin-Embedding 是专为增强中文文本检索能力而设计的嵌入模型
60
  ```python
61
  #pip install -U FlagEmbedding
62
 
63
- from FlagEmbedding import BGEM3FlagModel
64
 
65
- model = BGEM3FlagModel('chuxin-llm/Chuxin-Embedding',
66
- use_fp16=True) # Setting use_fp16 to True speeds up computation with a slight performance degradation
 
67
 
68
  sentences_1 = ["样例数据-1", "样例数据-2"]
69
  sentences_2 = ["样例数据-3", "样例数据-1"]
70
 
71
- embeddings_1 = model.encode(sentences_1,
72
- batch_size=12,
73
- max_length=1024,
74
- )['dense_vecs']
75
- embeddings_2 = model.encode(sentences_2)['dense_vecs']
76
  similarity = embeddings_1 @ embeddings_2.T
77
  print(similarity)
78
 
 
60
  ```python
61
  #pip install -U FlagEmbedding
62
 
63
+ from FlagEmbedding import FlagModel
64
 
65
+ model = FlagModel('chuxin-llm/Chuxin-Embedding',
66
+ query_instruction_for_retrieval="为这个句子生成表示以用于检索相关文章:",
67
+ use_fp16=True)
68
 
69
  sentences_1 = ["样例数据-1", "样例数据-2"]
70
  sentences_2 = ["样例数据-3", "样例数据-1"]
71
 
72
+ embeddings_1 = model.encode(sentences_1)
73
+ embeddings_2 = model.encode(sentences_2)
 
 
 
74
  similarity = embeddings_1 @ embeddings_2.T
75
  print(similarity)
76