Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,15 +25,14 @@ def main():
|
|
| 25 |
|
| 26 |
uploaded_file = st.sidebar.file_uploader("Choose a PDF file", type="pdf")
|
| 27 |
|
| 28 |
-
|
| 29 |
api_input = st.sidebar.text_input(
|
| 30 |
"Enter The API KEY 👇",
|
| 31 |
label_visibility=st.session_state.visibility,
|
| 32 |
disabled=st.session_state.disabled
|
| 33 |
-
type="password"
|
| 34 |
-
|
| 35 |
|
| 36 |
-
if uploaded_file is not None:
|
| 37 |
save_folder = 'docs/'
|
| 38 |
save_path = Path(save_folder, uploaded_file.name)
|
| 39 |
with open(save_path, mode='wb') as w:
|
|
@@ -42,11 +41,8 @@ def main():
|
|
| 42 |
st.sidebar.success("File uploaded successfully",icon="✅")
|
| 43 |
|
| 44 |
vector_store = PDF_4_QA(save_path)
|
|
|
|
| 45 |
QA_Bot(vector_store,api_input)
|
| 46 |
|
| 47 |
-
# else:
|
| 48 |
-
# vector_store = PDF_4_QA("docs/SamarthTandon_cv_2.pdf")
|
| 49 |
-
# QA_Bot(vector_store,api_input)
|
| 50 |
-
|
| 51 |
if __name__ == '__main__':
|
| 52 |
main()
|
|
|
|
| 25 |
|
| 26 |
uploaded_file = st.sidebar.file_uploader("Choose a PDF file", type="pdf")
|
| 27 |
|
|
|
|
| 28 |
api_input = st.sidebar.text_input(
|
| 29 |
"Enter The API KEY 👇",
|
| 30 |
label_visibility=st.session_state.visibility,
|
| 31 |
disabled=st.session_state.disabled
|
| 32 |
+
type="password")
|
| 33 |
+
|
| 34 |
|
| 35 |
+
if uploaded_file is not None and api_input is not None:
|
| 36 |
save_folder = 'docs/'
|
| 37 |
save_path = Path(save_folder, uploaded_file.name)
|
| 38 |
with open(save_path, mode='wb') as w:
|
|
|
|
| 41 |
st.sidebar.success("File uploaded successfully",icon="✅")
|
| 42 |
|
| 43 |
vector_store = PDF_4_QA(save_path)
|
| 44 |
+
st.sidebar.success("Vector database created successfully",icon="✅")
|
| 45 |
QA_Bot(vector_store,api_input)
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
if __name__ == '__main__':
|
| 48 |
main()
|