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

Fix: Default max comparison pairs in resolve.py #147

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
custom limits added
  • Loading branch information
staru09 committed Nov 5, 2024
commit e9bfef4c24024e6b430f9f327c55bf9105bef0f1
8 changes: 6 additions & 2 deletions docetl/operations/resolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,11 @@ def merge_clusters(item1: int, item2: int) -> None:

# Compute an auto-batch size based on the number of comparisons
def auto_batch() -> int:
# Maximum batch size limit for 4o-mini model
M = 500
# Get model-specific rate limit from pipeline
model = self.config.get("comparison_model", self.default_model)
rate_limit = self.runner.api.get_rate_limit(model)
# Use the rate limit as our maximum batch size
M = rate_limit["requests_per_minute"]

n = len(input_data)
m = len(blocked_pairs)
Expand All @@ -446,6 +449,7 @@ def auto_batch() -> int:

# Compare pairs and update clusters in real-time
batch_size = self.config.get("compare_batch_size", auto_batch())
rate_info = self.runner.pipeline.get_rate_limits(self.config.get("comparison_model", self.default_model))
self.console.log(f"Using compare batch size: {batch_size}")
pair_costs = 0

Expand Down
Loading