Spaces:
Sleeping
Sleeping
Download config/redis_config.py from DvorakInnovationAI/GenAI-FASTAPI: direct link, hf CLI and curl.
- Browser
- Download file 375 Bytes
-
https://huggingface.co/spaces/DvorakInnovationAI/GenAI-FASTAPI/resolve/main/config/redis_config.py
- Command line
-
hf download hf://spaces/DvorakInnovationAI/GenAI-FASTAPI/config/redis_config.py
-
curl -L -o redis_config.py https://huggingface.co/spaces/DvorakInnovationAI/GenAI-FASTAPI/resolve/main/config/redis_config.py
375 Bytes
| from redis import Redis | |
| import os | |
| # Load Redis credentials from environment | |
| password = os.environ['REDIS_PASSWORD'] | |
| host = os.environ['REDIS_HOST'] | |
| port = os.environ.get('REDIS_PORT', 6379) # default fallback | |
| # Initialize Redis client | |
| redis_client = Redis( | |
| host=host, | |
| port=port, | |
| db=0, | |
| decode_responses=True, | |
| username="default", | |
| password=password | |
| ) | |