Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,11 +15,11 @@ import time
|
|
| 15 |
# --- Constants ---
|
| 16 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 17 |
|
|
|
|
| 18 |
# Rate limiting configuration
|
| 19 |
MAX_MODEL_CALLS_PER_MINUTE = 14 # Conservative buffer below 15 RPM
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
TOKEN_BUCKET_REFILL_RATE = RATE_LIMIT / 60.0 # Tokens per second
|
| 23 |
|
| 24 |
# Initialize global token bucket with MemoryStorage
|
| 25 |
storage = MemoryStorage()
|
|
|
|
| 15 |
# --- Constants ---
|
| 16 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 17 |
|
| 18 |
+
|
| 19 |
# Rate limiting configuration
|
| 20 |
MAX_MODEL_CALLS_PER_MINUTE = 14 # Conservative buffer below 15 RPM
|
| 21 |
+
TOKEN_BUCKET_CAPACITY = MAX_MODEL_CALLS_PER_MINUTE
|
| 22 |
+
TOKEN_BUCKET_REFILL_RATE = MAX_MODEL_CALLS_PER_MINUTE / 60.0 # Tokens per second
|
|
|
|
| 23 |
|
| 24 |
# Initialize global token bucket with MemoryStorage
|
| 25 |
storage = MemoryStorage()
|