Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mruwnik committed Jun 19, 2024
1 parent acc4cac commit 2e71355
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions align_data/embeddings/pinecone/pinecone_db_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ def wrapper(*args, **kwargs):
return f(*args, **kwargs)
except exceptions as e:
logger.error(f'Got exception while retrying: {e}')
except Exception as e:
breakpoint()
time.sleep(2 ** i)
raise TimeoutError(f'Gave up after {n} tries')
return wrapper
Expand Down
2 changes: 1 addition & 1 deletion align_data/embeddings/pinecone/update_pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def batch_entries(
yield [(article, self._make_pinecone_entry(article)) for article in batch]

def _make_pinecone_entry(self, article: Article) -> PineconeEntry | None:
logger.info(f'Getting embeddings for {article.title}')
try:
text_chunks = get_text_chunks(article, self.text_splitter)
embeddings, moderation_results = get_embeddings(text_chunks, article.source)
Expand Down Expand Up @@ -148,7 +149,6 @@ def _make_pinecone_entry(self, article: Article) -> PineconeEntry | None:
return None

except Exception as e:
breakpoint()
logger.error(e)
raise

Expand Down

0 comments on commit 2e71355

Please sign in to comment.