Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
app.py
CHANGED
@@ -52,10 +52,10 @@ if "faq" not in st.session_state:
|
|
52 |
|
53 |
st.divider()
|
54 |
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
def create_pickle_file(filepath):
|
61 |
|
@@ -96,9 +96,9 @@ def create_pickle_file(filepath):
|
|
96 |
pickle.dump(faiss_index, f)
|
97 |
|
98 |
|
99 |
-
uploaded_file =
|
100 |
if uploaded_file is not None:
|
101 |
-
create_pickle_file(uploaded_file)
|
102 |
|
103 |
def highlight_pdf(file_path, text_to_highlight, page_numbers):
|
104 |
# Create a temporary file to save the modified PDF
|
|
|
52 |
|
53 |
st.divider()
|
54 |
|
55 |
+
def upload_file():
|
56 |
+
uploaded_file = st.file_uploader("Upload a file", type=["pdf"])
|
57 |
+
if uploaded_file is not None:
|
58 |
+
return uploaded_file.read()
|
59 |
|
60 |
def create_pickle_file(filepath):
|
61 |
|
|
|
96 |
pickle.dump(faiss_index, f)
|
97 |
|
98 |
|
99 |
+
uploaded_file = upload_file()
|
100 |
if uploaded_file is not None:
|
101 |
+
create_pickle_file(uploaded_file.name)
|
102 |
|
103 |
def highlight_pdf(file_path, text_to_highlight, page_numbers):
|
104 |
# Create a temporary file to save the modified PDF
|