Spaces:
Runtime error
Runtime error
Download env.py from VioletWizard/Talk-Trace-AI: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/spaces/VioletWizard/Talk-Trace-AI/resolve/main/env.py
- Command line
-
hf download hf://spaces/VioletWizard/Talk-Trace-AI/env.py
-
curl -L -o env.py https://huggingface.co/spaces/VioletWizard/Talk-Trace-AI/resolve/main/env.py
381 Bytes
| import os | |
| import streamlit as st | |
| def get_secret(key: str, default: str = "") -> str: | |
| """환경변수(HF Spaces) → st.secrets(Streamlit Cloud) 순서로 값을 읽습니다.""" | |
| env_val = os.environ.get(key, "").strip() | |
| if env_val: | |
| return env_val | |
| try: | |
| return str(st.secrets.get(key, default)).strip() | |
| except Exception: | |
| return default | |