Daaku-C5 commited on
Commit
4052c60
·
verified ·
1 Parent(s): 2e20326

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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("OPENAI_API_KEY", None)
25
  if not api_key:
26
  # Fallback to environment variable
27
- api_key = os.environ.get("OPENAI_API_KEY")
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.")