From 38e4a630ee5d7c2007ebfd5a58cbbc957c00fbbf Mon Sep 17 00:00:00 2001 From: Gustav von Zitzewitz Date: Mon, 15 May 2023 10:25:39 +0200 Subject: [PATCH] move load_dotenv to constants --- app.py | 8 ++------ constants.py | 5 +++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 85020dd..3e18ea8 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,4 @@ import streamlit as st -from dotenv import load_dotenv from streamlit_chat import message from constants import ( @@ -9,8 +8,8 @@ from constants import ( DEFAULT_DATA_SOURCE, OPENAI_HELP, PAGE_ICON, - USAGE_HELP, REPO_URL, + USAGE_HELP, ) from utils import ( authenticate, @@ -21,9 +20,6 @@ from utils import ( save_uploaded_file, ) -load_dotenv() - - # Page options and header st.set_option("client.showErrorDetails", True) st.set_page_config( @@ -82,7 +78,7 @@ with st.sidebar: if submitted: authenticate(openai_api_key, activeloop_token, activeloop_org_name) - st.info("Learn how it works [here]({REPO_URL})") + st.info(f"Learn how it works [here]({REPO_URL})") if not st.session_state["auth_ok"]: st.stop() diff --git a/constants.py b/constants.py index e3d0c88..b4c84dd 100644 --- a/constants.py +++ b/constants.py @@ -1,5 +1,10 @@ from pathlib import Path +from dotenv import load_dotenv + +# loads environment variables +load_dotenv() + APP_NAME = "DataChad" MODEL = "gpt-3.5-turbo" PAGE_ICON = "🤖"