fix(train_page): 捕获训练过程中的异常并终止 TensorBoard 进程
- 在训练过程中添加异常捕获,将异常信息转换为 gr.Error 抛出 - 确保在发生异常时也能终止 TensorBoard 子进程
This commit is contained in:
parent
0a4efa5641
commit
9806334517
@ -82,6 +82,8 @@ def train_page():
|
||||
dataset, new_training_dir,
|
||||
learning_rate, per_device_train_batch_size, epoch,
|
||||
save_steps, lora_rank)
|
||||
except Exception as e:
|
||||
raise gr.Error(str(e))
|
||||
finally:
|
||||
# 确保训练结束后终止 TensorBoard 子进程
|
||||
tensorboard_process.terminate()
|
||||
|
Loading…
x
Reference in New Issue
Block a user