johnmuchiri commited on
Commit
bb90a67
1 Parent(s): 1404580

let's deploy to huggingface spaces

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,7 +13,7 @@ from langchain.document_loaders import UnstructuredPDFLoader, OnlinePDFLoader
13
  import pinecone
14
 
15
  # Set the path where you want to save the uploaded PDF file
16
- SAVE_DIR = "pdfs"
17
 
18
 
19
  st.header('Question Answering with your PDF file')
@@ -99,8 +99,8 @@ with left_column:
99
  if uploaded_file is not None:
100
  # Save the uploaded file to the specified directory
101
  file_path = os.path.join(SAVE_DIR, uploaded_file.name)
102
- # with open(file_path, "wb") as f:
103
- # f.write(uploaded_file.getbuffer())
104
  st.success(f"File path {file_path}")
105
  query = st.text_input("enter your question")
106
  chain_type = st.selectbox(
 
13
  import pinecone
14
 
15
  # Set the path where you want to save the uploaded PDF file
16
+ SAVE_DIR = "pdf"
17
 
18
 
19
  st.header('Question Answering with your PDF file')
 
99
  if uploaded_file is not None:
100
  # Save the uploaded file to the specified directory
101
  file_path = os.path.join(SAVE_DIR, uploaded_file.name)
102
+ with open(file_path, "wb") as f:
103
+ f.write(uploaded_file.getbuffer())
104
  st.success(f"File path {file_path}")
105
  query = st.text_input("enter your question")
106
  chain_type = st.selectbox(