Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -2
src/streamlit_app.py
CHANGED
|
@@ -21,10 +21,10 @@ TEMP_AUDIO_FILE = "temp_audio.wav"
|
|
| 21 |
def init_openai_client():
|
| 22 |
try:
|
| 23 |
# Try to get API key from Streamlit secrets first (for HF Spaces)
|
| 24 |
-
api_key = st.secrets.get("
|
| 25 |
if not api_key:
|
| 26 |
# Fallback to environment variable
|
| 27 |
-
api_key = os.environ.get("
|
| 28 |
|
| 29 |
if not api_key:
|
| 30 |
st.error("⚠️ OpenAI API key not found. Please add OPENAI_API_KEY to your Hugging Face Spaces secrets.")
|
|
|
|
| 21 |
def init_openai_client():
|
| 22 |
try:
|
| 23 |
# Try to get API key from Streamlit secrets first (for HF Spaces)
|
| 24 |
+
api_key = st.secrets.get("openai", None)
|
| 25 |
if not api_key:
|
| 26 |
# Fallback to environment variable
|
| 27 |
+
api_key = os.environ.get("openai")
|
| 28 |
|
| 29 |
if not api_key:
|
| 30 |
st.error("⚠️ OpenAI API key not found. Please add OPENAI_API_KEY to your Hugging Face Spaces secrets.")
|