Spaces:
Sleeping
Sleeping
Commit
·
19ca13a
1
Parent(s):
98e9f16
小修改代码,让col1变得更离散
Browse files
app.py
CHANGED
@@ -242,25 +242,23 @@ def app():
|
|
242 |
course_outline_string += f"{lessons_count}." + outline[0] + '\n'
|
243 |
course_outline_string += '\n' + outline[1] + '\n\n'
|
244 |
#time.sleep(1)
|
245 |
-
with col1:
|
246 |
-
with st.expander("Check the course outline", expanded=False):
|
247 |
st.write(course_outline_string)
|
248 |
|
249 |
col1.vdb_state = st.text("Constructing vector database from provided materials...")
|
250 |
embeddings_df, faiss_index = constructVDB(temp_file_paths)
|
251 |
col1.vdb_state.text("Constructing vector database from provided materials...Done")
|
252 |
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
st.markdown(courseContent)
|
264 |
|
265 |
user_question = st.chat_input("Enter your questions when learning...")
|
266 |
|
|
|
242 |
course_outline_string += f"{lessons_count}." + outline[0] + '\n'
|
243 |
course_outline_string += '\n' + outline[1] + '\n\n'
|
244 |
#time.sleep(1)
|
245 |
+
with col1.st.expander("Check the course outline", expanded=False):
|
|
|
246 |
st.write(course_outline_string)
|
247 |
|
248 |
col1.vdb_state = st.text("Constructing vector database from provided materials...")
|
249 |
embeddings_df, faiss_index = constructVDB(temp_file_paths)
|
250 |
col1.vdb_state.text("Constructing vector database from provided materials...Done")
|
251 |
|
252 |
+
count_generating_content = 0
|
253 |
+
for lesson in course_outline_list:
|
254 |
+
count_generating_content += 1
|
255 |
+
content_generating_state = st.text(f"Writing content for lesson {count_generating_content}...")
|
256 |
+
retrievedChunksList = searchVDB(lesson, embeddings_df, faiss_index)
|
257 |
+
courseContent = generateCourse(lesson, retrievedChunksList, language)
|
258 |
+
content_generating_state.text(f"Writing content for lesson {count_generating_content}...Done")
|
259 |
+
#st.text_area("Course Content", value=courseContent)
|
260 |
+
with col1.st.expander(f"Learn the lesson {count_generating_content} ", expanded=False):
|
261 |
+
st.markdown(courseContent)
|
|
|
262 |
|
263 |
user_question = st.chat_input("Enter your questions when learning...")
|
264 |
|