Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,6 @@ from langchain_community.vectorstores import FAISS
|
|
| 5 |
from langchain_community.embeddings import OpenAIEmbeddings
|
| 6 |
from langchain_community.chat_models import ChatOpenAI
|
| 7 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 8 |
-
from streamlit.runtime.scriptrunner import add_script_run_ctx, get_script_run_ctx
|
| 9 |
-
|
| 10 |
-
# Ensure Streamlit runs in the correct execution context
|
| 11 |
-
ctx = get_script_run_ctx()
|
| 12 |
-
add_script_run_ctx(ctx)
|
| 13 |
|
| 14 |
# Configure Streamlit app
|
| 15 |
st.set_page_config(page_title="📚 Curriculum Assistant", layout="wide")
|
|
@@ -55,4 +50,4 @@ if user_input:
|
|
| 55 |
st.session_state["messages"].append(("Assistant", response))
|
| 56 |
|
| 57 |
for role, msg in st.session_state["messages"]:
|
| 58 |
-
st.chat_message(role).write(msg)
|
|
|
|
| 5 |
from langchain_community.embeddings import OpenAIEmbeddings
|
| 6 |
from langchain_community.chat_models import ChatOpenAI
|
| 7 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Configure Streamlit app
|
| 10 |
st.set_page_config(page_title="📚 Curriculum Assistant", layout="wide")
|
|
|
|
| 50 |
st.session_state["messages"].append(("Assistant", response))
|
| 51 |
|
| 52 |
for role, msg in st.session_state["messages"]:
|
| 53 |
+
st.chat_message(role).write(msg)
|