Spaces:
Runtime error
Runtime error
Update pages/Phase1.py
Browse files- pages/Phase1.py +7 -5
pages/Phase1.py
CHANGED
|
@@ -89,11 +89,13 @@ for message in st.session_state.messages:
|
|
| 89 |
st.markdown(message["content"])
|
| 90 |
|
| 91 |
# Upload PDF
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
| 97 |
|
| 98 |
# Accept user input
|
| 99 |
if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
|
|
| 89 |
st.markdown(message["content"])
|
| 90 |
|
| 91 |
# Upload PDF
|
| 92 |
+
|
| 93 |
+
with st.sidebar:
|
| 94 |
+
uploaded_file = st.file_uploader("Choose a PDF file", type="pdf")
|
| 95 |
+
if uploaded_file is not None:
|
| 96 |
+
pdf_text = read_pdf(uploaded_file)
|
| 97 |
+
st.session_state.pdf_text = pdf_text
|
| 98 |
+
st.write("PDF content loaded successfully!")
|
| 99 |
|
| 100 |
# Accept user input
|
| 101 |
if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|