Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,16 +10,18 @@ from dotenv import load_dotenv # Import dotenv
|
|
| 10 |
# Load environment variables from .env file
|
| 11 |
load_dotenv()
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
api_key = os.getenv("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")
|
| 15 |
|
| 16 |
# Debugging line to verify the API key is loaded
|
|
|
|
|
|
|
| 17 |
if api_key:
|
| 18 |
st.success("Groq API key loaded successfully.")
|
| 19 |
client = Groq(api_key=api_key)
|
| 20 |
else:
|
| 21 |
st.warning("Groq API key is not set. Features requiring Groq API will be disabled.")
|
| 22 |
-
client = None
|
| 23 |
|
| 24 |
# App title
|
| 25 |
st.title("Optimized EV Charging Scheduling in Microgrids")
|
|
|
|
| 10 |
# Load environment variables from .env file
|
| 11 |
load_dotenv()
|
| 12 |
|
| 13 |
+
# Fetch the API key from the environment
|
| 14 |
+
api_key = os.getenv("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")
|
| 15 |
|
| 16 |
# Debugging line to verify the API key is loaded
|
| 17 |
+
st.write("Loaded API Key:", api_key)
|
| 18 |
+
|
| 19 |
if api_key:
|
| 20 |
st.success("Groq API key loaded successfully.")
|
| 21 |
client = Groq(api_key=api_key)
|
| 22 |
else:
|
| 23 |
st.warning("Groq API key is not set. Features requiring Groq API will be disabled.")
|
| 24 |
+
client = None
|
| 25 |
|
| 26 |
# App title
|
| 27 |
st.title("Optimized EV Charging Scheduling in Microgrids")
|