Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -7
src/streamlit_app.py
CHANGED
|
@@ -5,16 +5,13 @@ import os
|
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
from langchain_community.document_loaders import WebBaseLoader
|
| 7 |
|
| 8 |
-
# Load environment variables
|
| 9 |
load_dotenv()
|
| 10 |
|
| 11 |
-
# Get API key from
|
| 12 |
-
|
| 13 |
-
api_key = st.secrets['GROQ_API_KEY']
|
| 14 |
-
except KeyError:
|
| 15 |
-
api_key = os.getenv('GROQ_API_KEY')
|
| 16 |
if not api_key:
|
| 17 |
-
st.error("GROQ_API_KEY not found in
|
| 18 |
st.stop()
|
| 19 |
|
| 20 |
# Function to load the article/blog post from a URL
|
|
|
|
| 5 |
from dotenv import load_dotenv
|
| 6 |
from langchain_community.document_loaders import WebBaseLoader
|
| 7 |
|
| 8 |
+
# Load environment variables
|
| 9 |
load_dotenv()
|
| 10 |
|
| 11 |
+
# Get API key from .env
|
| 12 |
+
api_key = os.getenv('GROQ_API_KEY')
|
|
|
|
|
|
|
|
|
|
| 13 |
if not api_key:
|
| 14 |
+
st.error("GROQ_API_KEY not found in .env file. Please add it to the .env file in your Hugging Face Space or local environment.")
|
| 15 |
st.stop()
|
| 16 |
|
| 17 |
# Function to load the article/blog post from a URL
|