mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-20 13:54:48 +00:00
community[patch]: FAISS: ValueError mentions normalize_score_fn isntead of relevance_score_fn (#25225)
Thank you for contributing to LangChain! - [X] **PR title**: "community: fix valueerror mentions wrong argument missing" - Where "package" is whichever of langchain, community, core, experimental, etc. is being modified. Use "docs: ..." for purely docs changes, "templates: ..." for template changes, "infra: ..." for CI changes. - Example: "community: add foobar LLM" - [X] **PR message**: ***Delete this entire checklist*** and replace with - **Description:** when faiss.py has a None relevance_score_fn it raises a ValueError that says a normalize_fn_score argument is needed. Co-authored-by: ccurme <chester.curme@gmail.com>
This commit is contained in:
parent
4825dc0d76
commit
a2b4c33bd6
@ -1288,7 +1288,7 @@ class FAISS(VectorStore):
|
|||||||
relevance_score_fn = self._select_relevance_score_fn()
|
relevance_score_fn = self._select_relevance_score_fn()
|
||||||
if relevance_score_fn is None:
|
if relevance_score_fn is None:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"normalize_score_fn must be provided to"
|
"relevance_score_fn must be provided to"
|
||||||
" FAISS constructor to normalize scores"
|
" FAISS constructor to normalize scores"
|
||||||
)
|
)
|
||||||
docs_and_scores = self.similarity_search_with_score(
|
docs_and_scores = self.similarity_search_with_score(
|
||||||
@ -1317,7 +1317,7 @@ class FAISS(VectorStore):
|
|||||||
relevance_score_fn = self._select_relevance_score_fn()
|
relevance_score_fn = self._select_relevance_score_fn()
|
||||||
if relevance_score_fn is None:
|
if relevance_score_fn is None:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"normalize_score_fn must be provided to"
|
"relevance_score_fn must be provided to"
|
||||||
" FAISS constructor to normalize scores"
|
" FAISS constructor to normalize scores"
|
||||||
)
|
)
|
||||||
docs_and_scores = await self.asimilarity_search_with_score(
|
docs_and_scores = await self.asimilarity_search_with_score(
|
||||||
|
Loading…
Reference in New Issue
Block a user