Compare commits

...

2 Commits

Author SHA1 Message Date
94fe6f2571 fix 2023-11-28 17:16:29 +01:00
d4adba658e fix 2023-11-28 17:15:56 +01:00
2 changed files with 15 additions and 0 deletions

View File

@ -16,6 +16,15 @@ rendered properly in your Markdown viewer.
# RAG
<Tip warning={true}>
The class `LegacyIndex` used to define the retriever component `RagRetriever` in the `RAG` architecture was deprecated
due to security issues linked to `pickle.load`.
For improved security, we recommend using `CanonicalHFIndex` or `CustomHFIndex` to build and load your index dataset.
</Tip>
<div class="flex flex-wrap space-x-1">
<a href="https://huggingface.co/models?filter=rag">
<img alt="Models" src="https://img.shields.io/badge/All_model_pages-rag-blueviolet">

View File

@ -103,6 +103,12 @@ class LegacyIndex(Index):
PASSAGE_FILENAME = "psgs_w100.tsv.pkl"
def __init__(self, vector_size, index_path):
logger.error(
"`LegacyIndex` was deprecated due to security issues linked to `pickle.load`. See more details on this "
"model's documentation page: "
"`https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/rag.md`."
)
self.index_id_to_db_id = []
self.index_path = index_path
self.passages = self._load_passages()