Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -177,13 +177,13 @@ def handle_userinput(question, pdf_vectorstore, dfs):
|
|
| 177 |
if response_type == 'dataframe':
|
| 178 |
st.session_state.chat_history.append({
|
| 179 |
"role": "assistant",
|
| 180 |
-
"content": "Here's the
|
| 181 |
"dataframe": response_value
|
| 182 |
})
|
| 183 |
elif response_type == 'plot':
|
| 184 |
st.session_state.chat_history.append({
|
| 185 |
"role": "assistant",
|
| 186 |
-
"content": "Here's the
|
| 187 |
"plot": response_value
|
| 188 |
})
|
| 189 |
else:
|
|
@@ -206,7 +206,7 @@ def handle_userinput(question, pdf_vectorstore, dfs):
|
|
| 206 |
st.error(f"Error processing input: {e}")
|
| 207 |
|
| 208 |
def main():
|
| 209 |
-
st.set_page_config(page_title="Chat with PDFs
|
| 210 |
|
| 211 |
# Initialize session state variables
|
| 212 |
if "conversation" not in st.session_state:
|
|
@@ -233,11 +233,13 @@ def main():
|
|
| 233 |
|
| 234 |
# Sidebar for file upload
|
| 235 |
with st.sidebar:
|
|
|
|
| 236 |
st.subheader("Your files")
|
| 237 |
uploaded_files = st.file_uploader(
|
| 238 |
"Upload PDFs, CSVs, or Excel files (up to 3)",
|
| 239 |
accept_multiple_files=True,
|
| 240 |
-
key="file_uploader"
|
|
|
|
| 241 |
)
|
| 242 |
|
| 243 |
if st.button("Process"):
|
|
|
|
| 177 |
if response_type == 'dataframe':
|
| 178 |
st.session_state.chat_history.append({
|
| 179 |
"role": "assistant",
|
| 180 |
+
"content": "Here's the table:",
|
| 181 |
"dataframe": response_value
|
| 182 |
})
|
| 183 |
elif response_type == 'plot':
|
| 184 |
st.session_state.chat_history.append({
|
| 185 |
"role": "assistant",
|
| 186 |
+
"content": "Here's the chart:",
|
| 187 |
"plot": response_value
|
| 188 |
})
|
| 189 |
else:
|
|
|
|
| 206 |
st.error(f"Error processing input: {e}")
|
| 207 |
|
| 208 |
def main():
|
| 209 |
+
st.set_page_config(page_title="Chat with PDFs or your Data", page_icon=":books:")
|
| 210 |
|
| 211 |
# Initialize session state variables
|
| 212 |
if "conversation" not in st.session_state:
|
|
|
|
| 233 |
|
| 234 |
# Sidebar for file upload
|
| 235 |
with st.sidebar:
|
| 236 |
+
st.sidebar.image("logoqb.jpeg", use_container_width=True)
|
| 237 |
st.subheader("Your files")
|
| 238 |
uploaded_files = st.file_uploader(
|
| 239 |
"Upload PDFs, CSVs, or Excel files (up to 3)",
|
| 240 |
accept_multiple_files=True,
|
| 241 |
+
key="file_uploader",
|
| 242 |
+
type=['pdf', 'csv', 'xlsx', 'xls']
|
| 243 |
)
|
| 244 |
|
| 245 |
if st.button("Process"):
|