Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,7 @@ ip_access_records = defaultdict(lambda: {
|
|
31 |
'last_access_time': None
|
32 |
})
|
33 |
|
|
|
34 |
AUTHORIZED_API_KEY = os.getenv("HF_API_KEY")
|
35 |
|
36 |
def is_authorized(request: gr.Request):
|
@@ -38,7 +39,8 @@ def is_authorized(request: gr.Request):
|
|
38 |
api_key = request.headers.get("API-Key")
|
39 |
print("API-Key received:", api_key) # Log the received API key for debugging
|
40 |
return api_key == AUTHORIZED_API_KEY
|
41 |
-
|
|
|
42 |
SESSION_TIMEOUT = timedelta(hours=1)
|
43 |
|
44 |
# Function to log API access attempts
|
|
|
31 |
'last_access_time': None
|
32 |
})
|
33 |
|
34 |
+
'''
|
35 |
AUTHORIZED_API_KEY = os.getenv("HF_API_KEY")
|
36 |
|
37 |
def is_authorized(request: gr.Request):
|
|
|
39 |
api_key = request.headers.get("API-Key")
|
40 |
print("API-Key received:", api_key) # Log the received API key for debugging
|
41 |
return api_key == AUTHORIZED_API_KEY
|
42 |
+
'''
|
43 |
+
|
44 |
SESSION_TIMEOUT = timedelta(hours=1)
|
45 |
|
46 |
# Function to log API access attempts
|