Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug notebook #1250

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
set opensearch embedding for largest resolution to FAKE
nora-errouhly committed Dec 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 32e846f14264ab6d05d3fd5ffec2abf6236378dc
8 changes: 5 additions & 3 deletions redbox-core/redbox/loader/ingester.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
from langchain_core.runnables import RunnableParallel
from langchain_elasticsearch.vectorstores import BM25Strategy, ElasticsearchStore
from langchain_community.vectorstores import OpenSearchVectorSearch
from langchain_core.embeddings import FakeEmbeddings

from redbox.chains.components import get_embeddings
from redbox.chains.ingest import ingest_from_loader
@@ -51,7 +52,8 @@ def get_elasticsearch_store_without_embeddings(es, es_index_name: str):
return OpenSearchVectorSearch(
index_name=es_index_name,
opensearch_url=env.elastic.collection_endpoint,
embedding_function=get_embeddings(env),
#embedding_function=get_embeddings(env),
embedding_function=FakeEmbeddings(size=3072)
)


@@ -112,8 +114,8 @@ def _ingest_file(file_name: str, es_index_name: str = alias):
env=env,
)

#new_ids = RunnableParallel({"normal": chunk_ingest_chain, "largest": large_chunk_ingest_chain}).invoke(file_name)
new_ids = RunnableParallel({"normal": chunk_ingest_chain}).invoke(file_name) #test one task to identify root cause
new_ids = RunnableParallel({"normal": chunk_ingest_chain, "largest": large_chunk_ingest_chain}).invoke(file_name)
#new_ids = RunnableParallel({"normal": chunk_ingest_chain}).invoke(file_name) #test one task to identify root cause
logging.info(
"File: %s %s chunks ingested",
file_name,