Spaces:
Running
Running
Update to new Demo rate limits. Unlimited use on studio.yourmirror.io
Browse files
app.py
CHANGED
|
@@ -96,8 +96,8 @@ except Exception as exc:
|
|
| 96 |
# Rate Limiting
|
| 97 |
# -----------------------------------------------------------------------------
|
| 98 |
|
| 99 |
-
# Rate limiter:
|
| 100 |
-
RATE_LIMIT_REQUESTS =
|
| 101 |
RATE_LIMIT_WINDOW = 3600 # 1 hour in seconds
|
| 102 |
request_tracker = defaultdict(deque)
|
| 103 |
|
|
@@ -362,7 +362,7 @@ def generate(
|
|
| 362 |
# Rate limiting check
|
| 363 |
client_ip = get_client_ip(request)
|
| 364 |
if not check_rate_limit(client_ip):
|
| 365 |
-
raise gr.Error("Rate
|
| 366 |
|
| 367 |
# NSFW content filtering - only check product image
|
| 368 |
print(f"[NSFW] Checking product image for inappropriate content...")
|
|
|
|
| 96 |
# Rate Limiting
|
| 97 |
# -----------------------------------------------------------------------------
|
| 98 |
|
| 99 |
+
# Rate limiter: 5 requests per IP per hour
|
| 100 |
+
RATE_LIMIT_REQUESTS = 5
|
| 101 |
RATE_LIMIT_WINDOW = 3600 # 1 hour in seconds
|
| 102 |
request_tracker = defaultdict(deque)
|
| 103 |
|
|
|
|
| 362 |
# Rate limiting check
|
| 363 |
client_ip = get_client_ip(request)
|
| 364 |
if not check_rate_limit(client_ip):
|
| 365 |
+
raise gr.Error("Rate Limit Quota Exceeded - Visit studio.yourmirror.io to sign up for unlimited use")
|
| 366 |
|
| 367 |
# NSFW content filtering - only check product image
|
| 368 |
print(f"[NSFW] Checking product image for inappropriate content...")
|