进度条提前

This commit is contained in:
2023-02-19 06:21:03 +08:00
parent f714c0db32
commit f7a646447e
2 changed files with 7 additions and 7 deletions

View File

@@ -261,7 +261,7 @@ def main_dev(opt):
print(f"加载到显存完成: {model_name}")
# 更新任务状态为运行中
update_task_status(task, "running", 0)
update_task_status(task, "running", 0.5)
# 使用指定的模型和配置文件进行推理一组参数
if opt.plms:
@@ -307,7 +307,7 @@ def main_dev(opt):
start_code = torch.randn([task['number'], opt.C, opt.H // opt.f, opt.W // opt.f], device=device)
# 更新进度
update_task_status(task, "running", 0.1)
update_task_status(task, "running", 0.8)
# 生成图片
precision_scope = autocast if opt.precision == "autocast" or opt.bf16 else nullcontext
@@ -323,7 +323,7 @@ def main_dev(opt):
prompts = list(prompts)
c = model.get_learned_conditioning(prompts)
shape = [opt.C, opt.H // opt.f, opt.W // opt.f]
update_task_status(task=task, status='diffusing', progress=0.5) # 修改任务状态
update_task_status(task=task, status='diffusing', progress=0.9) # 修改任务状态
samples, _ = sampler.sample(S=opt.steps,
conditioning=c,
batch_size=task['number'],