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 the default max comparison pairs in resolve.py #130

Open
shreyashankar opened this issue Oct 28, 2024 · 3 comments · May be fixed by #147
Open

Fix the default max comparison pairs in resolve.py #130

shreyashankar opened this issue Oct 28, 2024 · 3 comments · May be fixed by #147

Comments

@shreyashankar
Copy link
Collaborator

Currently we have hard-coded an upper bound to 500, as in here. This should be set based on llm rate limits.

@staru09
Copy link
Contributor

staru09 commented Nov 3, 2024

def auto_batch() -> int:
            model = self.config.get("comparison_model", self.default_model)
            rate_limits = self.runner.api.get_rate_limits(model)
            
            M = rate_limits.get("requests_per_minute", 500) if rate_limits else 500
            
            n = len(input_data)
            m = len(blocked_pairs)
            
            discriminant = (1 - 2*n)**2 - 8*m
            sqrt_discriminant = discriminant ** 0.5
            
            k1 = -0.5 * sqrt_discriminant + n + 0.5
            k2 = 0.5 * (sqrt_discriminant + 2*n + 1)

will something like this work?

@shreyashankar
Copy link
Collaborator Author

where is the get_rate_limits function coming from?

@staru09
Copy link
Contributor

staru09 commented Nov 4, 2024

This is to be defined as a wrapper class for API calls.
We will give a bunch of default values for different models which can be modified by the user too.

@staru09 staru09 linked a pull request Nov 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants