Spaces:
Running
Running
Commit
·
a81f00b
1
Parent(s):
9e6a8cb
加入regenerate
Browse files
app.py
CHANGED
@@ -348,25 +348,32 @@ def app():
|
|
348 |
2. Touch "submit" button
|
349 |
|
350 |
🎉 Get ready to see what happens..
|
351 |
-
|
352 |
'''
|
353 |
)
|
354 |
|
355 |
|
356 |
if btn:
|
357 |
-
|
358 |
-
|
359 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
col1, col2 = st.columns([0.6,0.4])
|
368 |
-
|
369 |
-
user_question = st.chat_input("Enter your questions when learning...")
|
370 |
|
371 |
if user_question:
|
372 |
st.session_state.description1.empty()
|
|
|
348 |
2. Touch "submit" button
|
349 |
|
350 |
🎉 Get ready to see what happens..
|
|
|
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 |
+
user_question = st.chat_input("Enter your questions when learning...")
|
369 |
+
|
370 |
+
if regenerate_button:
|
371 |
+
continue
|
372 |
+
elif user_question:
|
373 |
+
break
|
374 |
|
|
|
|
|
|
|
|
|
|
|
375 |
|
376 |
col1, col2 = st.columns([0.6,0.4])
|
|
|
|
|
377 |
|
378 |
if user_question:
|
379 |
st.session_state.description1.empty()
|