From b0c571e9cc776fc20a78a43e59166c539e424d70 Mon Sep 17 00:00:00 2001 From: SapphireLab Date: Sat, 10 Feb 2024 17:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbatch=5Fsize=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/subfix_webui.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tools/subfix_webui.py b/tools/subfix_webui.py index d6624d03..e1f08b42 100644 --- a/tools/subfix_webui.py +++ b/tools/subfix_webui.py @@ -24,10 +24,10 @@ g_data_json = [] def reload_data(index, batch): - global g_index - g_index = index - global g_batch - g_batch = batch + # global g_index + # g_index = index + # global g_batch + # g_batch = batch datas = g_data_json[index:index+batch] output = [] for d in datas: @@ -41,8 +41,8 @@ def reload_data(index, batch): def b_change_index(index, batch): - global g_index, g_batch - g_index, g_batch = index, batch + # global g_index, g_batch + # g_index, g_batch = index, batch datas = reload_data(index, batch) output = [] for i , _ in enumerate(datas): @@ -354,11 +354,9 @@ if __name__ == "__main__": g_audio_list.append(audio_output) g_checkbox_list.append(audio_check) - - with gr.Row(): batchsize_slider = gr.Slider( - minimum=1, maximum=g_batch, value=g_batch, step=1, label="Batch Size", scale=3, interactive=False + minimum=1, maximum=g_batch, value=g_batch, step=1, label="Batch Size", scale=3, interactive=True ) interval_slider = gr.Slider( minimum=0, maximum=2, value=0, step=0.01, label="Interval", scale=3 @@ -379,7 +377,6 @@ if __name__ == "__main__": ], ) - btn_submit_change.click( b_submit_change, inputs=[