mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-22 19:09:57 +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:
@@ -152,6 +152,8 @@ class TFIDFRetriever(BaseRetriever):
|
||||
|
||||
# Load docs and tfidf array as pickle.
|
||||
with open(path / f"{file_name}.pkl", "rb") as f:
|
||||
docs, tfidf_array = pickle.load(f)
|
||||
# This code path can only be triggered if the user
|
||||
# passed allow_dangerous_deserialization=True
|
||||
docs, tfidf_array = pickle.load(f) # ignore[pickle]: explicit-opt-in
|
||||
|
||||
return cls(vectorizer=vectorizer, docs=docs, tfidf_array=tfidf_array)
|
||||
|
Reference in New Issue
Block a user