BrianIsaac commited on
Commit
9ec4319
·
1 Parent(s): 6c10ae1

fix: add missing audio button return value in analysis early exits

Browse files

The run_analysis_with_ui_update function was returning 8 values in early
exit paths but 9 values were expected by the caller. Added the missing
gr.update(visible=False) for audio button to both early return statements.

Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -777,7 +777,7 @@ async def run_analysis_with_ui_update(
777
  roast_mode: bool = False,
778
  persona: Optional[str] = None,
779
  progress=gr.Progress()
780
- ) -> Tuple[str, str, str, Any, Any, Any, Any, Any]:
781
  """Run analysis and return results with loading progress overlay.
782
 
783
  Uses rotating messages from LOADING_MESSAGES to display progress updates.
@@ -790,7 +790,7 @@ async def run_analysis_with_ui_update(
790
  progress: Gradio progress tracker
791
 
792
  Returns:
793
- Tuple of (page_state, analysis_text, performance_metrics, and 5 charts)
794
  """
795
  global LAST_ANALYSIS_STATE
796
 
@@ -799,7 +799,8 @@ async def run_analysis_with_ui_update(
799
  "input",
800
  "",
801
  "",
802
- None, None, None, None, None
 
803
  )
804
 
805
  try:
@@ -812,7 +813,8 @@ async def run_analysis_with_ui_update(
812
  "input",
813
  "",
814
  "",
815
- None, None, None, None, None
 
816
  )
817
 
818
  progress(0.1, desc=random.choice(LOADING_MESSAGES))
 
777
  roast_mode: bool = False,
778
  persona: Optional[str] = None,
779
  progress=gr.Progress()
780
+ ) -> Tuple[str, str, str, Any, Any, Any, Any, Any, Any]:
781
  """Run analysis and return results with loading progress overlay.
782
 
783
  Uses rotating messages from LOADING_MESSAGES to display progress updates.
 
790
  progress: Gradio progress tracker
791
 
792
  Returns:
793
+ Tuple of (page_state, analysis_text, performance_metrics, 5 charts, audio_btn_update)
794
  """
795
  global LAST_ANALYSIS_STATE
796
 
 
799
  "input",
800
  "",
801
  "",
802
+ None, None, None, None, None,
803
+ gr.update(visible=False)
804
  )
805
 
806
  try:
 
813
  "input",
814
  "",
815
  "",
816
+ None, None, None, None, None,
817
+ gr.update(visible=False)
818
  )
819
 
820
  progress(0.1, desc=random.choice(LOADING_MESSAGES))