Spaces:
Sleeping
Sleeping
Commit
·
f283568
1
Parent(s):
c772d78
试试看去掉regenerate会不会有变化
Browse files
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 |
-
|
313 |
-
|
314 |
-
|
|
|
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 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
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])
|