mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-01 02:50:47 +00:00
ci: Add script to check for pickle usage in community (#22863)
Add script to check for pickle usage in community.
This commit is contained in:
@@ -493,7 +493,13 @@ class ScaNN(VectorStore):
|
||||
|
||||
# load docstore and index_to_docstore_id
|
||||
with open(path / "{index_name}.pkl".format(index_name=index_name), "rb") as f:
|
||||
docstore, index_to_docstore_id = pickle.load(f)
|
||||
(
|
||||
docstore,
|
||||
index_to_docstore_id,
|
||||
) = pickle.load( # ignore[pickle]: explicit-opt-in
|
||||
f
|
||||
)
|
||||
|
||||
return cls(embedding, index, docstore, index_to_docstore_id, **kwargs)
|
||||
|
||||
def _select_relevance_score_fn(self) -> Callable[[float], float]:
|
||||
|
Reference in New Issue
Block a user