Spaces:
Running
on
Zero
Running
on
Zero
Ensure generation_time_display always has valid value to prevent JSON decode errors
Browse files
app.py
CHANGED
|
@@ -755,7 +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 |
-
#
|
|
|
|
|
|
|
|
|
|
| 759 |
return (
|
| 760 |
image, prompt, person_num, audio_mode,
|
| 761 |
audio1, audio2, audio3, gen_time
|
|
|
|
| 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 始终有有效值,避免缓存读取时的 JSON 解析错误
|
| 759 |
+
if not gen_time or gen_time.strip() == "":
|
| 760 |
+
# 如果 gen_time 为空,尝试从示例数据中恢复(这里作为备用,通常不会触发)
|
| 761 |
+
gen_time = "N/A"
|
| 762 |
return (
|
| 763 |
image, prompt, person_num, audio_mode,
|
| 764 |
audio1, audio2, audio3, gen_time
|