Siyuan0730 commited on
Commit
f283568
·
1 Parent(s): c772d78

试试看去掉regenerate会不会有变化

Browse files
Files changed (1) hide show
  1. app.py +13 -22
app.py CHANGED
@@ -309,9 +309,10 @@ def app():
309
  with st.sidebar:
310
  st.image("https://siyuan-harry.oss-cn-beijing.aliyuncs.com/oss://siyuan-harry/20231021212525.png")
311
  added_files = st.file_uploader('Upload .md and .pdf files, simultaneous mixed upload these types is supported.', type=['.md','.pdf'], accept_multiple_files=True)
312
- num_lessons = st.slider('How many lessons do you want this course to have?', min_value=2, max_value=15, value=5, step=1)
313
- language = 'English'
314
- Chinese = st.checkbox('Output in Chinese')
 
315
  if Chinese:
316
  language = 'Chinese'
317
  btn = st.button('submit')
@@ -351,26 +352,16 @@ def app():
351
  '''
352
  )
353
 
354
-
355
  if btn:
356
- while True:
357
- st.session_state.description1.empty()
358
- st.session_state.divider.empty()
359
- st.session_state.description2.empty()
360
-
361
- #initialize app
362
- temp_file_paths = initialize_file(added_files)
363
- st.session_state.embeddings_df, st.session_state.faiss_index = initialize_vdb(temp_file_paths)
364
- st.session_state.course_outline_list = initialize_outline(temp_file_paths, num_lessons, language)
365
- st.session_state.course_content_list = initialize_content(st.session_state.course_outline_list, st.session_state.embeddings_df, st.session_state.faiss_index, language)
366
-
367
- regenerate_button = st.button("Regenerate this course")
368
- confirm_button = st.button("This course is okay!")
369
-
370
- if regenerate_button:
371
- continue
372
- elif confirm_button:
373
- break
374
 
375
 
376
  col1, col2 = st.columns([0.6,0.4])
 
309
  with st.sidebar:
310
  st.image("https://siyuan-harry.oss-cn-beijing.aliyuncs.com/oss://siyuan-harry/20231021212525.png")
311
  added_files = st.file_uploader('Upload .md and .pdf files, simultaneous mixed upload these types is supported.', type=['.md','.pdf'], accept_multiple_files=True)
312
+ with st.expander('Customize your course'):
313
+ num_lessons = st.slider('How many lessons do you want this course to have?', min_value=2, max_value=15, value=5, step=1)
314
+ language = 'English'
315
+ Chinese = st.checkbox('Output in Chinese')
316
  if Chinese:
317
  language = 'Chinese'
318
  btn = st.button('submit')
 
352
  '''
353
  )
354
 
 
355
  if btn:
356
+ st.session_state.description1.empty()
357
+ st.session_state.divider.empty()
358
+ st.session_state.description2.empty()
359
+
360
+ #initialize app
361
+ temp_file_paths = initialize_file(added_files)
362
+ st.session_state.embeddings_df, st.session_state.faiss_index = initialize_vdb(temp_file_paths)
363
+ st.session_state.course_outline_list = initialize_outline(temp_file_paths, num_lessons, language)
364
+ st.session_state.course_content_list = initialize_content(st.session_state.course_outline_list, st.session_state.embeddings_df, st.session_state.faiss_index, language)
 
 
 
 
 
 
 
 
 
365
 
366
 
367
  col1, col2 = st.columns([0.6,0.4])