Skip to content

Commit 5573975

Browse files
committed
increase retries to 5
1 parent 112cd91 commit 5573975

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bespokelabs/curator/request_processor/openai_batch_request_processor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# NOTE(Ryan): This allows us to stay under the rate limit when submitting ~1,000 batches at a time
3333
# When submitting >1,000 batches the batch submission and batch download operations get rate limited
3434
MAX_CONCURRENT_BATCH_OPERATIONS = 100
35+
MAX_RETRIES_PER_OPERATION = 5
3536

3637

3738
class OpenAIBatchRequestProcessor(BaseRequestProcessor):
@@ -161,7 +162,7 @@ async def asubmit_batch(
161162
self, batch_file: str, semaphore: asyncio.Semaphore | None = None
162163
) -> dict:
163164
async with semaphore or asyncio.Semaphore(): # Use provided semaphore or dummy one
164-
async_client = AsyncOpenAI()
165+
async_client = AsyncOpenAI(max_retries=MAX_RETRIES_PER_OPERATION)
165166
# Create a list to store API-specific requests
166167
api_specific_requests = []
167168

0 commit comments

Comments
 (0)