Open clstaudt opened 1 year ago
Would a different strategy be possible that catches a RateLimitError when it occurs and then adapts?
You could use exponential_backoff
for that in OpenAI:
exponential_backoff: Retry requests with a random exponential backoff.
A short sleep is used when a rate limit error is hit,
then the requests is retried. Increase the sleep length
if errors are hit until 10 unsuccesfull requests.
If True, overrides `delay_in_seconds`.
If the RateLimitError is predictable (e.g. depending on dataset size) - is it avoidable?
It depends on the number of clusters you created since there will be one call for each cluster to create a label. If you have many clusters and you set it to a couple of seconds delay, then it will be the number of seconds times the number of clusters.
For my representation model
I am sometimes hitting a RateLimitError without exactly knowing what causes it (seems to happen when training on larger datasets of > 100 000 documents).
Setting a waiting time of even one second between API calls increases the training time several times (not sure why).