Skip to content

Commit

Permalink
refactor out a get_welcome_message() stub
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantisan committed Sep 27, 2023
1 parent 83a302b commit 195ce33
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions mind_palace/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
st.text("Coming soon...")


if "messages" not in st.session_state.keys(): # Initialize the chat messages history
st.session_state.messages = [
{"role": "assistant", "content": "Ask me a question about these PDFs"}
]


@st.cache_resource(show_spinner=False)
def load_index(model):
with st.spinner(
Expand All @@ -35,6 +29,17 @@ def load_index(model):
vector_index = load_index(gpt_model)
query_engine = CitationQueryEngine.from_args(index=vector_index, verbose=True)


def get_welcome_message():
return "Ask me a question about these PDFs"


if "messages" not in st.session_state.keys(): # Initialize the chat messages history
st.session_state.messages = [
{"role": "assistant", "content": get_welcome_message()}
]


if prompt := st.chat_input(
"Your question"
): # Prompt for user input and save to chat history
Expand Down

0 comments on commit 195ce33

Please sign in to comment.