Add a small sleep

This commit is contained in:
Vik Paruchuri
2025-11-12 16:06:02 -05:00
parent aafbb70ce8
commit 068db0311e

View File

@@ -1,5 +1,6 @@
import base64 import base64
import io import io
import time
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
from itertools import repeat from itertools import repeat
from typing import List from typing import List
@@ -112,6 +113,7 @@ def generate_vllm(
print( print(
f"Detected vllm error, retrying generation (attempt {retries + 1})..." f"Detected vllm error, retrying generation (attempt {retries + 1})..."
) )
time.sleep(2 * (retries + 1)) # Sleeping can help under load
return True return True
if ( if (
@@ -122,6 +124,7 @@ def generate_vllm(
print( print(
f"Detected vllm error, retrying generation (attempt {retries + 1})..." f"Detected vllm error, retrying generation (attempt {retries + 1})..."
) )
time.sleep(2 * (retries + 1)) # Sleeping can help under load
return True return True
return False return False