Download src/api/limiter.py from False45/math-api: direct link, hf CLI and curl.
- Browser
- Download file 254 Bytes
-
https://huggingface.co/spaces/False45/math-api/resolve/main/src/api/limiter.py
- Command line
-
hf download hf://spaces/False45/math-api/src/api/limiter.py
-
curl -L -o limiter.py https://huggingface.co/spaces/False45/math-api/resolve/main/src/api/limiter.py
254 Bytes
| from slowapi import Limiter, _rate_limit_exceeded_handler | |
| from slowapi.util import get_remote_address | |
| from slowapi.errors import RateLimitExceeded | |
| # Global rate limiter using the remote address as the key. | |
| limiter = Limiter(key_func=get_remote_address) | |