Skip to content

Commit

Permalink
remove ingest.py and pdf data
Browse files Browse the repository at this point in the history
Signed-off-by: letonghan <[email protected]>
  • Loading branch information
letonghan committed Dec 9, 2024
1 parent fbf3017 commit 89aabdc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 333 deletions.
99 changes: 0 additions & 99 deletions comps/retrievers/milvus/langchain/ingest.py

This file was deleted.

110 changes: 0 additions & 110 deletions comps/retrievers/qdrant/haystack/ingest.py

This file was deleted.

Binary file removed comps/retrievers/redis/data/nke-10k-2023.pdf
Binary file not shown.
121 changes: 0 additions & 121 deletions comps/retrievers/redis/langchain/ingest.py

This file was deleted.

12 changes: 9 additions & 3 deletions comps/retrievers/redis/langchain/retriever_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from redis_config import EMBED_MODEL, INDEX_NAME, REDIS_URL

from comps import (
EmbedMultimodalDoc,
SearchedMultimodalDoc,
CustomLogger,
EmbedDoc,
SearchedDoc,
Expand Down Expand Up @@ -64,10 +66,7 @@ async def retrieve(
embedding_data_input = []
for emb in embeddings:
# each emb is EmbeddingResponseData
# print("Embedding data: ", emb.embedding)
# print("Embedding data length: ",len(emb.embedding))
embedding_data_input.append(emb.embedding)
# print("All Embedding data length: ",len(embedding_data_input))
else:
embedding_data_input = input.embedding

Expand Down Expand Up @@ -98,6 +97,13 @@ async def retrieve(
for r in search_res:
retrieved_docs.append(TextDoc(text=r.page_content))
result = SearchedDoc(retrieved_docs=retrieved_docs, initial_query=input.text)
elif isinstance(input, EmbedMultimodalDoc):
metadata_list = []
for r in search_res:
metadata_list.append(r.metadata)
retrieved_docs.append(TextDoc(text=r.page_content))
result = SearchedMultimodalDoc(retrieved_docs=retrieved_docs, initial_query=input.text, metadata=metadata_list)

else:
for r in search_res:
retrieved_docs.append(RetrievalResponseData(text=r.page_content, metadata=r.metadata))
Expand Down

0 comments on commit 89aabdc

Please sign in to comment.