Spaces:
Running
Running
Download constants/envs.py from EBTRFIO/hf-llm-api: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/EBTRFIO/hf-llm-api/resolve/main/constants/envs.py
- Command line
-
hf download hf://spaces/EBTRFIO/hf-llm-api/constants/envs.py
-
curl -L -o envs.py https://huggingface.co/spaces/EBTRFIO/hf-llm-api/resolve/main/constants/envs.py
469 Bytes
| from pathlib import Path | |
| from tclogger import logger, OSEnver | |
| config_root = Path(__file__).parents[1] / "configs" | |
| secrets_path = config_root / "secrets.json" | |
| SECRETS = OSEnver(secrets_path) | |
| http_proxy = SECRETS["http_proxy"] | |
| if http_proxy: | |
| logger.note(f"> Using proxy: {http_proxy}") | |
| PROXIES = { | |
| "http": http_proxy, | |
| "https": http_proxy, | |
| } | |
| else: | |
| PROXIES = None | |
| config_path = config_root / "config.json" | |
| CONFIG = OSEnver(config_path) | |