binqiangliu commited on
Commit
ddd7ff1
·
1 Parent(s): c52b691

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -42,8 +42,8 @@ def generate_random_string(length):
42
  #random_string = generate_random_string(20)
43
  #directory_path=random_string
44
 
45
- if "directory_path" not in st.session_state:
46
- st.session_state.directory_path = generate_random_string(20)
47
 
48
  with st.sidebar:
49
  st.subheader("Upload your Documents Here: ")
@@ -56,7 +56,9 @@ with st.sidebar:
56
  st.stop()
57
  else: #如果已经上传文件,则装载文件SimpleDirectoryReader.load_data()
58
  #st.session_state.pdf_files=pdf_files
59
- if not os.path.exists(st.session_state.directory_path):
 
 
60
  os.makedirs(st.session_state.directory_path)
61
  for pdf_file in st.session_state.pdf_files:
62
  #for pdf_file in pdf_files:
 
42
  #random_string = generate_random_string(20)
43
  #directory_path=random_string
44
 
45
+ #if "directory_path" not in st.session_state:
46
+ # st.session_state.directory_path = generate_random_string(20)
47
 
48
  with st.sidebar:
49
  st.subheader("Upload your Documents Here: ")
 
56
  st.stop()
57
  else: #如果已经上传文件,则装载文件SimpleDirectoryReader.load_data()
58
  #st.session_state.pdf_files=pdf_files
59
+ #if not os.path.exists(st.session_state.directory_path):
60
+ if "directory_path" not in st.session_state:
61
+ st.session_state.directory_path = generate_random_string(20)
62
  os.makedirs(st.session_state.directory_path)
63
  for pdf_file in st.session_state.pdf_files:
64
  #for pdf_file in pdf_files: