Skip to content

Commit

Permalink
Merge pull request #307 from TogetherCrew/feat/302-telegram-raw-vecto…
Browse files Browse the repository at this point in the history
…rize

fix: wrong collection name assignment in ingestion pipeline!
  • Loading branch information
amindadgar authored Oct 21, 2024
2 parents 5eeb2c4 + cf6411a commit fbb843a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dags/hivemind_etl_helpers/ingestion_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, community_id: str, collection_name: str, testing: bool = Fals
_, self.embedding_dim = load_model_hyperparams()
self.pg_creds = load_postgres_credentials()
self.redis_cred = load_redis_credentials()
self.collection_name = community_id
self.collection_name = f"{community_id}_{collection_name}"
self.platform_name = collection_name

self.embed_model = (
Expand Down Expand Up @@ -63,8 +63,7 @@ def run_pipeline(self, docs: list[Document]) -> list[BaseNode]:
logging.info(
f"{len(docs)} docuemnts was extracted and now loading into QDrant DB!"
)
qdrant_collection_name = f"{self.collection_name}_{self.platform_name}"
vector_access = QDrantVectorAccess(collection_name=qdrant_collection_name)
vector_access = QDrantVectorAccess(collection_name=self.collection_name)
vector_store = vector_access.setup_qdrant_vector_store()

pipeline = IngestionPipeline(
Expand All @@ -74,13 +73,13 @@ def run_pipeline(self, docs: list[Document]) -> list[BaseNode]:
],
docstore=MongoDocumentStore.from_uri(
uri=get_mongo_uri(),
db_name=f"docstore_{self.collection_name}",
db_name=f"docstore_{self.community_id}",
namespace=self.platform_name,
),
vector_store=vector_store,
cache=IngestionCache(
cache=RedisCache.from_redis_client(self.redis_client),
collection=f"{self.collection_name}_{self.platform_name}_ingestion_cache",
collection=f"{self.collection_name}_ingestion_cache",
docstore_strategy=DocstoreStrategy.UPSERTS,
),
docstore_strategy=DocstoreStrategy.UPSERTS,
Expand Down

0 comments on commit fbb843a

Please sign in to comment.