Towhidul commited on
Commit
c067558
·
verified ·
1 Parent(s): 3ee932d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -32,6 +32,10 @@ st.sidebar.title("Settings")
32
  st.sidebar.subheader("Upload Knowledge Base")
33
  uploaded_file = st.sidebar.file_uploader("Upload a medical text book (pdf)", type=["jpg", "png", "pdf"])
34
 
 
 
 
 
35
  # Initialize the parser
36
  parser = LlamaParse(
37
  result_type="markdown",
@@ -52,7 +56,7 @@ md_json_objs = []
52
  # Upload and process file
53
  if uploaded_file:
54
  st.sidebar.write("Processing file...")
55
- file_path = f"files/{uploaded_file.name}"
56
  with open(file_path, "wb") as f:
57
  f.write(uploaded_file.read())
58
 
 
32
  st.sidebar.subheader("Upload Knowledge Base")
33
  uploaded_file = st.sidebar.file_uploader("Upload a medical text book (pdf)", type=["jpg", "png", "pdf"])
34
 
35
+ # # Ensure the 'files' directory exists
36
+ # if not os.path.exists("files"):
37
+ # os.makedirs("files")
38
+
39
  # Initialize the parser
40
  parser = LlamaParse(
41
  result_type="markdown",
 
56
  # Upload and process file
57
  if uploaded_file:
58
  st.sidebar.write("Processing file...")
59
+ file_path = f"{uploaded_file.name}"
60
  with open(file_path, "wb") as f:
61
  f.write(uploaded_file.read())
62