diff --git a/chyoso_toolkit_ui.py b/chyoso_toolkit_ui.py index ac3ccc3..6f4578b 100644 --- a/chyoso_toolkit_ui.py +++ b/chyoso_toolkit_ui.py @@ -290,7 +290,7 @@ with gr.Blocks() as iface: list_file_button = gr.Button("刷新文件") batch_process_button = gr.Button("批量处理") with gr.Column(): - batch_output_file = gr.File(label="批量转写结果") + batch_output_file = gr.Files(label="批量转写结果") with gr.Row(): log_output = gr.Textbox(label="日志信息", lines=10) @@ -350,6 +350,8 @@ with gr.Blocks() as iface: # 绑定按钮点击事件 process_button.click(batch_ocr, inputs=[input_files, user_query_text], outputs=output_file) - iface.load(fn=update_log_output, outputs=[log_output], every=1) + # 使用 Gradio 5 的定时器 API 周期性更新日志输出 + timer = gr.Timer(1.0) + timer.tick(fn=update_log_output, outputs=[log_output]) iface.launch(server_name="0.0.0.0") diff --git a/requirements.txt b/requirements.txt index 467c942..8a54e03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -gradio==4.44.0 +gradio==5.49.0 openai==1.44.1 python-dotenv~=1.0.1 pillow~=10.4.0 \ No newline at end of file