增加跟踪的一些逻辑代码

This commit is contained in:
2025-03-24 17:42:10 +08:00
parent bba39adcfc
commit f32cd5b9a2
47 changed files with 3395 additions and 17 deletions

View File

@ -218,12 +218,12 @@ async def run_commend(data: str, project: str, name: str, epochs: int, patience:
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, # 这里可以显示yolov5训练过程中出现的进度条等信息
text=True, # 缓存内容为文本,避免后续编码显示问题
encoding='latin1',
encoding='utf-8',
) as process:
while process.poll() is None:
line = process.stdout.readline()
process.stdout.flush() # 刷新缓存,防止缓存过多造成卡死
if line != '\n':
if line != '\n' and '0%' not in line:
await room_manager.send_to_room(room, line + '\n')
# 等待进程结束并获取返回码