C4G-HKUST commited on
Commit
3049f55
·
1 Parent(s): 60f55fe

Fix JSON decode error: add generation_time_display to outputs to match inputs for cache compatibility

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -755,10 +755,10 @@ def run_graio_demo(args):
755
  def handle_example_select(image, gen_time, prompt, person_num, audio_mode, audio1, audio2, audio3):
756
  # 三个音频输入框始终可见,只返回值,不改变可见性
757
  # 读取时根据 person_num_selector 只读取前 n 个音频
758
- # generation_time_display 不需要更新,所以不返回
759
  return (
760
  image, prompt, person_num, audio_mode,
761
- audio1, audio2, audio3
762
  )
763
 
764
  examples_component = gr.Examples(
@@ -768,7 +768,7 @@ def run_graio_demo(args):
768
  ["./input_example/images/2p-2.png", "~10 minutes", "In a cozy recording studio, a man and a woman are singing together. The man, with tousled brown hair, stands to the left, wearing a light green button-down shirt. His gaze is directed towards the woman, who is smiling warmly. She, with wavy dark hair, is dressed in a black floral dress and stands to the right, her eyes closed in enjoyment. Between them is a professional microphone, capturing their harmonious voices. The background features wooden panels and various audio equipment, creating an intimate and focused atmosphere. The lighting is soft and warm, highlighting their expressions and the intimate setting. A medium shot captures their interaction closely.", "2 Persons", "pad", "./input_example/audios/2p-2-left.wav", "./input_example/audios/2p-2-right.wav", None],
769
  ],
770
  inputs = [img2vid_image, generation_time_display, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3],
771
- outputs = [img2vid_image, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3],
772
  fn=handle_example_select,
773
  )
774
 
 
755
  def handle_example_select(image, gen_time, prompt, person_num, audio_mode, audio1, audio2, audio3):
756
  # 三个音频输入框始终可见,只返回值,不改变可见性
757
  # 读取时根据 person_num_selector 只读取前 n 个音频
758
+ # 需要返回 gen_time 以匹配 outputs,避免缓存问题
759
  return (
760
  image, prompt, person_num, audio_mode,
761
+ audio1, audio2, audio3, gen_time
762
  )
763
 
764
  examples_component = gr.Examples(
 
768
  ["./input_example/images/2p-2.png", "~10 minutes", "In a cozy recording studio, a man and a woman are singing together. The man, with tousled brown hair, stands to the left, wearing a light green button-down shirt. His gaze is directed towards the woman, who is smiling warmly. She, with wavy dark hair, is dressed in a black floral dress and stands to the right, her eyes closed in enjoyment. Between them is a professional microphone, capturing their harmonious voices. The background features wooden panels and various audio equipment, creating an intimate and focused atmosphere. The lighting is soft and warm, highlighting their expressions and the intimate setting. A medium shot captures their interaction closely.", "2 Persons", "pad", "./input_example/audios/2p-2-left.wav", "./input_example/audios/2p-2-right.wav", None],
769
  ],
770
  inputs = [img2vid_image, generation_time_display, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3],
771
+ outputs = [img2vid_image, img2vid_prompt, person_num_selector, audio_mode_selector, img2vid_audio_1, img2vid_audio_2, img2vid_audio_3, generation_time_display],
772
  fn=handle_example_select,
773
  )
774