Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -297,11 +297,14 @@ if st.button("Process Documents"):
|
|
| 297 |
|
| 298 |
# Step 2: Generate Summaries
|
| 299 |
st.subheader("Step 2: Generate Summaries")
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
)
|
|
|
|
|
|
|
|
|
|
| 305 |
if st.session_state.rag_system.document_summary:
|
| 306 |
st.text_area("Document Summary", st.session_state.rag_system.document_summary, height=200)
|
| 307 |
else:
|
|
@@ -314,11 +317,14 @@ if st.button("Generate Summary"):
|
|
| 314 |
|
| 315 |
# Step 3: Ask Questions
|
| 316 |
st.subheader("Step 3: Ask Questions")
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
)
|
|
|
|
|
|
|
|
|
|
| 322 |
if st.session_state.rag_system.qa_chain:
|
| 323 |
history = []
|
| 324 |
user_question = st.text_input("Ask a question:")
|
|
@@ -333,11 +339,14 @@ else:
|
|
| 333 |
|
| 334 |
# Step 4: Generate Podcast
|
| 335 |
st.subheader("Step 4: Generate Podcast")
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
)
|
|
|
|
|
|
|
|
|
|
| 341 |
if st.session_state.rag_system.document_summary:
|
| 342 |
if st.button("Generate Podcast"):
|
| 343 |
script, audio_path = st.session_state.rag_system.create_podcast(podcast_language)
|
|
|
|
| 297 |
|
| 298 |
# Step 2: Generate Summaries
|
| 299 |
st.subheader("Step 2: Generate Summaries")
|
| 300 |
+
st.write("Select Summary Language:")
|
| 301 |
+
summary_language_options = ["English", "Spanish", "French", "German", "Chinese"]
|
| 302 |
+
cols = st.columns(len(summary_language_options))
|
| 303 |
+
summary_language = None
|
| 304 |
+
for i, col in enumerate(cols):
|
| 305 |
+
if col.radio("", [summary_language_options[i]], key=f"summary_{i}"):
|
| 306 |
+
summary_language = summary_language_options[i]
|
| 307 |
+
|
| 308 |
if st.session_state.rag_system.document_summary:
|
| 309 |
st.text_area("Document Summary", st.session_state.rag_system.document_summary, height=200)
|
| 310 |
else:
|
|
|
|
| 317 |
|
| 318 |
# Step 3: Ask Questions
|
| 319 |
st.subheader("Step 3: Ask Questions")
|
| 320 |
+
st.write("Select Q&A Language:")
|
| 321 |
+
qa_language_options = ["English", "Spanish", "French", "German", "Chinese"]
|
| 322 |
+
cols = st.columns(len(qa_language_options))
|
| 323 |
+
qa_language = None
|
| 324 |
+
for i, col in enumerate(cols):
|
| 325 |
+
if col.radio("", [qa_language_options[i]], key=f"qa_{i}"):
|
| 326 |
+
qa_language = qa_language_options[i]
|
| 327 |
+
|
| 328 |
if st.session_state.rag_system.qa_chain:
|
| 329 |
history = []
|
| 330 |
user_question = st.text_input("Ask a question:")
|
|
|
|
| 339 |
|
| 340 |
# Step 4: Generate Podcast
|
| 341 |
st.subheader("Step 4: Generate Podcast")
|
| 342 |
+
st.write("Select Podcast Language:")
|
| 343 |
+
podcast_language_options = ["English", "Spanish", "French", "German", "Chinese"]
|
| 344 |
+
cols = st.columns(len(podcast_language_options))
|
| 345 |
+
podcast_language = None
|
| 346 |
+
for i, col in enumerate(cols):
|
| 347 |
+
if col.radio("", [podcast_language_options[i]], key=f"podcast_{i}"):
|
| 348 |
+
podcast_language = podcast_language_options[i]
|
| 349 |
+
|
| 350 |
if st.session_state.rag_system.document_summary:
|
| 351 |
if st.button("Generate Podcast"):
|
| 352 |
script, audio_path = st.session_state.rag_system.create_podcast(podcast_language)
|