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:
staoxiao 2023-10-18 02:58:29 +08:00 committed by GitHub
parent f4742dce50
commit 23c261ba57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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",