Skip to content

Commit

Permalink
chore: prevent out of expected limit for scraped data size
Browse files Browse the repository at this point in the history
  • Loading branch information
Amber-Williams committed Jan 1, 2024
1 parent d1764f4 commit c16cde1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

batch_size = df['token_count'].sum() / settings.TOKEN_LIMIT
batched_df = np.array_split(df, batch_size)
if len(batched_df) > 30:
raise ValueError(f"Batch size is too large: {len(batched_df)}")

chat = ChatExtractor(
model_key=settings.OPENAI_API_KEY,
model=settings.OPENAI_MODEL,
Expand Down

0 comments on commit c16cde1

Please sign in to comment.