Spaces:
Sleeping
Sleeping
Dua Rajper commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,16 @@
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 3 |
from groq import Groq
|
|
|
|
| 4 |
|
| 5 |
-
#
|
|
|
|
|
|
|
|
|
|
| 6 |
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
|
|
|
|
| 7 |
if not GROQ_API_KEY:
|
| 8 |
-
st.error("Please set the GROQ_API_KEY
|
| 9 |
st.stop()
|
| 10 |
|
| 11 |
# Initialize Groq client
|
|
|
|
| 1 |
import os
|
| 2 |
import streamlit as st
|
| 3 |
from groq import Groq
|
| 4 |
+
from dotenv import load_dotenv
|
| 5 |
|
| 6 |
+
# Load .env file
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
+
# Fetch API key
|
| 10 |
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
|
| 11 |
+
|
| 12 |
if not GROQ_API_KEY:
|
| 13 |
+
st.error("Please set the GROQ_API_KEY in the .env file and restart the app.")
|
| 14 |
st.stop()
|
| 15 |
|
| 16 |
# Initialize Groq client
|