DrishtiSharma commited on
Commit
16cee10
·
verified ·
1 Parent(s): 313e06c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -14
app.py CHANGED
@@ -300,10 +300,13 @@ 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)
@@ -319,11 +322,12 @@ if st.button("Generate Summary"):
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 = []
@@ -341,11 +345,12 @@ else:
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"):
 
300
  st.write("Select Summary Language:")
301
  summary_language_options = ["English", "Spanish", "French", "German", "Chinese"]
302
  cols = st.columns(len(summary_language_options))
303
+ # Default selected option
304
+ summary_language = st.radio(
305
+ "",
306
+ summary_language_options,
307
+ horizontal=True,
308
+ key="summary_language"
309
+ )
310
 
311
  if st.session_state.rag_system.document_summary:
312
  st.text_area("Document Summary", st.session_state.rag_system.document_summary, height=200)
 
322
  st.subheader("Step 3: Ask Questions")
323
  st.write("Select Q&A Language:")
324
  qa_language_options = ["English", "Spanish", "French", "German", "Chinese"]
325
+ qa_language = st.radio(
326
+ "",
327
+ qa_language_options,
328
+ horizontal=True,
329
+ key="qa_language"
330
+ )
331
 
332
  if st.session_state.rag_system.qa_chain:
333
  history = []
 
345
  st.subheader("Step 4: Generate Podcast")
346
  st.write("Select Podcast Language:")
347
  podcast_language_options = ["English", "Spanish", "French", "German", "Chinese"]
348
+ podcast_language = st.radio(
349
+ "",
350
+ podcast_language_options,
351
+ horizontal=True,
352
+ key="podcast_language"
353
+ )
354
 
355
  if st.session_state.rag_system.document_summary:
356
  if st.button("Generate Podcast"):