[fix] Bring draft progress and model progress in sync with model loader (#125)

* Bring draft progress and model progress in sync with model loader

* Fix formatting
This commit is contained in:
turboderp
2024-06-03 19:41:02 +02:00
committed by GitHub
parent a011c17488
commit 0eb8fa5d1e

View File

@@ -62,14 +62,15 @@ async def load_model_gen(model_path: pathlib.Path, **kwargs):
)
else:
progress.advance(loading_task)
yield module, modules, model_type
if module == modules:
# Switch to model progress if the draft model is loaded
if model_type == "draft":
model_type = "model"
else:
progress.stop()
yield module, modules, model_type
finally:
progress.stop()