Spaces:
Running
Running
clementruhm
commited on
Commit
·
4575e0b
1
Parent(s):
8ca90cb
Update app.py
Browse files
app.py
CHANGED
@@ -128,10 +128,10 @@ def main():
|
|
128 |
past_requests_ = users.get(ip_, 0)
|
129 |
free_tier_ = False
|
130 |
if not api_key_ or not api_secret_:
|
131 |
-
|
132 |
api_key_ = os.environ["api_key"]
|
133 |
api_secret_ = os.environ["api_secret"]
|
134 |
-
if
|
135 |
logging.info(f"Free tier exceeded for {ip_}")
|
136 |
return 16000, audio_msg
|
137 |
logging.info(f"Total number of requests: {counter}. {past_requests_} for {ip_}")
|
|
|
128 |
past_requests_ = users.get(ip_, 0)
|
129 |
free_tier_ = False
|
130 |
if not api_key_ or not api_secret_:
|
131 |
+
free_tier_ = True
|
132 |
api_key_ = os.environ["api_key"]
|
133 |
api_secret_ = os.environ["api_secret"]
|
134 |
+
if free_tier_ and past_requests_ >= FREE_TIER:
|
135 |
logging.info(f"Free tier exceeded for {ip_}")
|
136 |
return 16000, audio_msg
|
137 |
logging.info(f"Total number of requests: {counter}. {past_requests_} for {ip_}")
|