mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Update bge_huggingface.ipynb (#8960)
- Description: Considering the similarity computation method of [BGE](https://github.com/FlagOpen/FlagEmbedding) model is cosine similarity, set normalize_embeddings to be True. - Tag maintainer: @baskaryan Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
parent
f4742dce50
commit
23c261ba57
@ -36,7 +36,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"model_name = \"BAAI/bge-small-en\"\n",
|
"model_name = \"BAAI/bge-small-en\"\n",
|
||||||
"model_kwargs = {'device': 'cpu'}\n",
|
"model_kwargs = {'device': 'cpu'}\n",
|
||||||
"encode_kwargs = {'normalize_embeddings': False}\n",
|
"encode_kwargs = {'normalize_embeddings': True}\n",
|
||||||
"hf = HuggingFaceBgeEmbeddings(\n",
|
"hf = HuggingFaceBgeEmbeddings(\n",
|
||||||
" model_name=model_name,\n",
|
" model_name=model_name,\n",
|
||||||
" model_kwargs=model_kwargs,\n",
|
" model_kwargs=model_kwargs,\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user