Spaces:
Paused
Paused
make more limits
Browse files
app.py
CHANGED
|
@@ -278,8 +278,7 @@ class ClientGenerationManager:
|
|
| 278 |
with self.lock:
|
| 279 |
self.request_timestamps.append(time.time())
|
| 280 |
|
| 281 |
-
def has_exceeded_limit(self,
|
| 282 |
-
limit=50): # Default limit: 50 requests per hour
|
| 283 |
with self.lock:
|
| 284 |
current_time = time.time()
|
| 285 |
# Filter timestamps to only include those within the last hour
|
|
@@ -538,8 +537,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 538 |
print(f"Client IP: {client_ip}")
|
| 539 |
client_generation_manager = ClientManager.get_manager(client_ip)
|
| 540 |
client_generation_manager.update_activity()
|
| 541 |
-
if client_generation_manager.has_exceeded_limit(limit=
|
| 542 |
-
error_message = "❌ Your network has exceeded the limit of
|
| 543 |
yield (
|
| 544 |
error_message,
|
| 545 |
error_message,
|
|
|
|
| 278 |
with self.lock:
|
| 279 |
self.request_timestamps.append(time.time())
|
| 280 |
|
| 281 |
+
def has_exceeded_limit(self, limit=20):
|
|
|
|
| 282 |
with self.lock:
|
| 283 |
current_time = time.time()
|
| 284 |
# Filter timestamps to only include those within the last hour
|
|
|
|
| 537 |
print(f"Client IP: {client_ip}")
|
| 538 |
client_generation_manager = ClientManager.get_manager(client_ip)
|
| 539 |
client_generation_manager.update_activity()
|
| 540 |
+
if client_generation_manager.has_exceeded_limit(limit=20):
|
| 541 |
+
error_message = "❌ Your network has exceeded the limit of 20 requests per hour. Please try again later."
|
| 542 |
yield (
|
| 543 |
error_message,
|
| 544 |
error_message,
|