Gary Simmons
commited on
Commit
·
63c91ce
1
Parent(s):
c74fc86
correct verbose setting method and improve exponential backoff calculation
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ import litellm
|
|
| 9 |
from litellm import RateLimitError
|
| 10 |
|
| 11 |
# Enable debug mode to see detailed error information
|
| 12 |
-
litellm.
|
| 13 |
from smolagents import (
|
| 14 |
CodeAgent,
|
| 15 |
DuckDuckGoSearchTool,
|
|
@@ -142,7 +142,7 @@ class RateLimitedModel:
|
|
| 142 |
# Use exponential backoff for 503 errors, longer delays
|
| 143 |
if is_server_overload:
|
| 144 |
delay = min(
|
| 145 |
-
120, self.base_delay * (2
|
| 146 |
) + random.uniform(0, 10)
|
| 147 |
else:
|
| 148 |
delay = self.base_delay + random.uniform(0, 5)
|
|
|
|
| 9 |
from litellm import RateLimitError
|
| 10 |
|
| 11 |
# Enable debug mode to see detailed error information
|
| 12 |
+
litellm.verbose = True
|
| 13 |
from smolagents import (
|
| 14 |
CodeAgent,
|
| 15 |
DuckDuckGoSearchTool,
|
|
|
|
| 142 |
# Use exponential backoff for 503 errors, longer delays
|
| 143 |
if is_server_overload:
|
| 144 |
delay = min(
|
| 145 |
+
120, self.base_delay * (2**attempt)
|
| 146 |
) + random.uniform(0, 10)
|
| 147 |
else:
|
| 148 |
delay = self.base_delay + random.uniform(0, 5)
|