soctopus2327 commited on
Commit
31cd393
·
verified ·
1 Parent(s): a0cfb47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -3,19 +3,14 @@ import requests
3
  import openai
4
  from io import BytesIO
5
  from PIL import Image
6
- import os
7
- from dotenv import load_dotenv
8
 
9
  # Set page configuration as the first Streamlit command
10
  st.set_page_config(page_title="Eco-Symphony", page_icon="🌱", layout="centered")
11
 
12
- # Load environment variables from .env file
13
- load_dotenv()
14
-
15
- # Set API keys from environment
16
- openai.api_key = os.getenv("OPENAI_API_KEY")
17
- OPENWEATHER_API_KEY = os.getenv("OPENWEATHER_API_KEY")
18
- HUGGINGFACE_API_KEY = os.getenv("HUGGINGFACE_API_KEY")
19
 
20
  # Hugging Face API URLs
21
  MUSICGEN_API_URL = "https://api-inference.huggingface.co/models/facebook/musicgen-small"
 
3
  import openai
4
  from io import BytesIO
5
  from PIL import Image
 
 
6
 
7
  # Set page configuration as the first Streamlit command
8
  st.set_page_config(page_title="Eco-Symphony", page_icon="🌱", layout="centered")
9
 
10
+ # Set API keys from Streamlit Secrets
11
+ openai.api_key = st.secrets["OPENAI_API_KEY"]
12
+ OPENWEATHER_API_KEY = st.secrets["OPENWEATHER_API_KEY"]
13
+ HUGGINGFACE_API_KEY = st.secrets["HUGGINGFACE_API_KEY"]
 
 
 
14
 
15
  # Hugging Face API URLs
16
  MUSICGEN_API_URL = "https://api-inference.huggingface.co/models/facebook/musicgen-small"