Update app.py
Browse files
app.py
CHANGED
@@ -125,16 +125,6 @@ elif uploaded_files:
|
|
125 |
# Call the function
|
126 |
query_database = list_to_nums(documents)
|
127 |
|
128 |
-
# Create reference table
|
129 |
-
refs_tab = query_search(
|
130 |
-
"pful for understanding federal income",
|
131 |
-
documents,
|
132 |
-
query_database,
|
133 |
-
sources,
|
134 |
-
q_levels,
|
135 |
-
)
|
136 |
-
refs_tab = refs_tab.head(math.ceil(top_n))
|
137 |
-
|
138 |
# React to user input
|
139 |
if prompt := st.chat_input("What is up?"):
|
140 |
# Display user message in chat message container
|
@@ -142,10 +132,20 @@ elif uploaded_files:
|
|
142 |
# Add user message to chat history
|
143 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
144 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
result = refs_tab
|
146 |
|
147 |
# Display assistant response in chat message container
|
148 |
with st.chat_message("assistant"):
|
149 |
st.table(result)
|
|
|
150 |
# Add assistant response to chat history
|
151 |
st.session_state.messages.append({"role": "assistant", "content": result})
|
|
|
125 |
# Call the function
|
126 |
query_database = list_to_nums(documents)
|
127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
# React to user input
|
129 |
if prompt := st.chat_input("What is up?"):
|
130 |
# Display user message in chat message container
|
|
|
132 |
# Add user message to chat history
|
133 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
134 |
|
135 |
+
# Create reference table
|
136 |
+
refs_tab = query_search(
|
137 |
+
prompt,
|
138 |
+
documents,
|
139 |
+
query_database,
|
140 |
+
sources,
|
141 |
+
q_levels,
|
142 |
+
)
|
143 |
+
refs_tab = refs_tab.head(math.ceil(top_n))
|
144 |
result = refs_tab
|
145 |
|
146 |
# Display assistant response in chat message container
|
147 |
with st.chat_message("assistant"):
|
148 |
st.table(result)
|
149 |
+
|
150 |
# Add assistant response to chat history
|
151 |
st.session_state.messages.append({"role": "assistant", "content": result})
|