Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -1
src/streamlit_app.py
CHANGED
@@ -30,8 +30,13 @@ if 'ai_reply' not in st.session_state:
|
|
30 |
def load_context():
|
31 |
"""Load the context from file."""
|
32 |
try:
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
return f.read()
|
|
|
35 |
except FileNotFoundError:
|
36 |
st.error("Context file not found!")
|
37 |
return ""
|
|
|
30 |
def load_context():
|
31 |
"""Load the context from file."""
|
32 |
try:
|
33 |
+
base_dir = os.path.dirname(os.path.abspath(__file__))
|
34 |
+
|
35 |
+
context_path = os.path.join(base_dir, 'context.txt')
|
36 |
+
|
37 |
+
with open(context_path, "r") as f:
|
38 |
return f.read()
|
39 |
+
|
40 |
except FileNotFoundError:
|
41 |
st.error("Context file not found!")
|
42 |
return ""
|