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

Response caching with ResponseGenerator, CounterfactualGenerator #111

Open
dylanbouchard opened this issue Jan 28, 2025 · 1 comment · May be fixed by #121
Open

Response caching with ResponseGenerator, CounterfactualGenerator #111

dylanbouchard opened this issue Jan 28, 2025 · 1 comment · May be fixed by #121

Comments

@dylanbouchard
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Enable response caching for the two generator classes so that if an exception is raised (e.g. RateLimitError) partway through generation, re-generation of those already-generated responses is not required.

Describe the solution you'd like
Ideally, this would involve a batch_size or similar parameter for the generate_responses methods. The prompts would be partitioned and generation would occur in batches (e.g. in a loop). If an exception is raised in batch k, responses 1 through (k-1) would still be available to the user. We are thinking of using the following approach: cache the successfully generated responses from batches 1 through (k-1) and start at batch k in subsequent run of generate_responses method if failure occurs. Ideally, this would be using something temporary on the filesystem rather than something in memory, like an instance attribute.

Describe alternatives you've considered
Status quo

Additional context
It may be useful to add a time dimension to help avoid RateLimitError. Specifically, this could involve pausing before starting batch k if batch (k-1) completed in fewer than n seconds. This could be accomplished with a min_time_per_batch parameter.

@dylanbouchard
Copy link
Collaborator Author

This issue is assigned to @renzmann

@dylanbouchard dylanbouchard linked a pull request Feb 12, 2025 that will close this issue
8 tasks
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.

1 participant