zach commited on
Commit
e99bbac
·
1 Parent(s): 5e28baf

Fix missing expected argument warning caused by some lambdas not expecting an argument

Browse files
Files changed (1) hide show
  1. src/app.py +7 -7
src/app.py CHANGED
@@ -476,7 +476,7 @@ class App:
476
  # 2. Generate text
477
  # 3. Enable the "Generate text" button
478
  generate_text_button.click(
479
- fn=lambda: gr.update(interactive=False),
480
  inputs=[],
481
  outputs=[generate_text_button],
482
  ).then(
@@ -484,7 +484,7 @@ class App:
484
  inputs=[character_description_input],
485
  outputs=[text_input, generated_text_state],
486
  ).then(
487
- fn=lambda: gr.update(interactive=True),
488
  inputs=[],
489
  outputs=[generate_text_button],
490
  )
@@ -495,7 +495,7 @@ class App:
495
  # 3. Synthesize speech, load audio players, and display vote button
496
  # 4. Enable the "Synthesize speech" button and display vote buttons
497
  synthesize_speech_button.click(
498
- fn=lambda: (
499
  gr.update(interactive=False),
500
  gr.update(interactive=False),
501
  gr.update(interactive=False),
@@ -527,7 +527,7 @@ class App:
527
  character_description_state,
528
  ],
529
  ).then(
530
- fn=lambda: (
531
  gr.update(interactive=True),
532
  gr.update(interactive=True),
533
  gr.update(interactive=True),
@@ -538,7 +538,7 @@ class App:
538
 
539
  # Vote button click event handlers
540
  vote_button_a.click(
541
- fn=lambda: (
542
  gr.update(interactive=False),
543
  gr.update(interactive=False),
544
  ),
@@ -565,7 +565,7 @@ class App:
565
  )
566
 
567
  vote_button_b.click(
568
- fn=lambda: (
569
  gr.update(interactive=False),
570
  gr.update(interactive=False),
571
  ),
@@ -603,7 +603,7 @@ class App:
603
 
604
  # Enable voting after second audio option playback finishes
605
  option_b_audio_player.stop(
606
- fn=lambda _: gr.update(autoplay=False),
607
  inputs=[],
608
  outputs=[option_b_audio_player],
609
  )
 
476
  # 2. Generate text
477
  # 3. Enable the "Generate text" button
478
  generate_text_button.click(
479
+ fn=lambda _=None: gr.update(interactive=False),
480
  inputs=[],
481
  outputs=[generate_text_button],
482
  ).then(
 
484
  inputs=[character_description_input],
485
  outputs=[text_input, generated_text_state],
486
  ).then(
487
+ fn=lambda _=None: gr.update(interactive=True),
488
  inputs=[],
489
  outputs=[generate_text_button],
490
  )
 
495
  # 3. Synthesize speech, load audio players, and display vote button
496
  # 4. Enable the "Synthesize speech" button and display vote buttons
497
  synthesize_speech_button.click(
498
+ fn=lambda _=None: (
499
  gr.update(interactive=False),
500
  gr.update(interactive=False),
501
  gr.update(interactive=False),
 
527
  character_description_state,
528
  ],
529
  ).then(
530
+ fn=lambda _=None: (
531
  gr.update(interactive=True),
532
  gr.update(interactive=True),
533
  gr.update(interactive=True),
 
538
 
539
  # Vote button click event handlers
540
  vote_button_a.click(
541
+ fn=lambda _=None: (
542
  gr.update(interactive=False),
543
  gr.update(interactive=False),
544
  ),
 
565
  )
566
 
567
  vote_button_b.click(
568
+ fn=lambda _=None: (
569
  gr.update(interactive=False),
570
  gr.update(interactive=False),
571
  ),
 
603
 
604
  # Enable voting after second audio option playback finishes
605
  option_b_audio_player.stop(
606
+ fn=lambda _=None: gr.update(autoplay=False),
607
  inputs=[],
608
  outputs=[option_b_audio_player],
609
  )