Skip to content

Commit

Permalink
disable file upload for InMemoryDocStore (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-risch committed Nov 1, 2021
1 parent efdcd24 commit c8df476
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions rest_api/controller/file_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
path=Path(PIPELINE_YAML_PATH), pipeline_name=INDEXING_PIPELINE_NAME, overwrite_with_env_variables=True
)
# Since each instance of FAISSDocumentStore creates an in-memory FAISS index, the Indexing & Query Pipelines would
# end up with different indices. The check below prevents creation of Indexing Pipelines with FAISSDocumentStore.
is_faiss_present = False
# end up with different indices. The same applies for InMemoryDocumentStore. The check below prevents creation of
# Indexing Pipelines with FAISSDocumentStore or InMemoryDocumentStore.
is_faiss_or_inmemory_present = False
for node in pipeline_config["nodes"]:
if definitions[node["name"]]["type"] == "FAISSDocumentStore":
is_faiss_present = True
if definitions[node["name"]]["type"] == "FAISSDocumentStore" or definitions[node["name"]]["type"] == "InMemoryDocumentStore":
is_faiss_or_inmemory_present = True
break
if is_faiss_present:
logger.warning("Indexing Pipeline with FAISSDocumentStore is not supported with the REST APIs.")
if is_faiss_or_inmemory_present:
logger.warning("Indexing Pipeline with FAISSDocumentStore or InMemoryDocumentStore is not supported with the REST APIs.")
INDEXING_PIPELINE = None
else:
INDEXING_PIPELINE = Pipeline.load_from_yaml(Path(PIPELINE_YAML_PATH), pipeline_name=INDEXING_PIPELINE_NAME)
Expand Down

0 comments on commit c8df476

Please sign in to comment.