mirror of
https://github.com/datalab-to/chandra.git
synced 2025-11-29 08:33:13 +00:00
Add a small sleep
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user