Spaces:
Sleeping
Sleeping
Commit ·
b9938e6
1
Parent(s): 148668c
IP limit (set 100 per day)
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
| 14 |
client = InferenceClient("Trinoid/Data_Management")
|
| 15 |
|
| 16 |
# Rate limiting settings
|
| 17 |
-
MAX_REQUESTS_PER_DAY =
|
| 18 |
ip_request_counters = defaultdict(int) # Tracks request count per IP
|
| 19 |
ip_last_reset = {} # Tracks when counters were last reset for each IP
|
| 20 |
rate_limit_lock = threading.Lock() # Lock for thread-safe counter access
|
|
|
|
| 14 |
client = InferenceClient("Trinoid/Data_Management")
|
| 15 |
|
| 16 |
# Rate limiting settings
|
| 17 |
+
MAX_REQUESTS_PER_DAY = 100 # Maximum number of requests per IP per day (set to 1 for testing)
|
| 18 |
ip_request_counters = defaultdict(int) # Tracks request count per IP
|
| 19 |
ip_last_reset = {} # Tracks when counters were last reset for each IP
|
| 20 |
rate_limit_lock = threading.Lock() # Lock for thread-safe counter access
|