Skip to content

Commit

Permalink
Model: Fix load packets
Browse files Browse the repository at this point in the history
The model_type internal reference was changed to an enum for
a more extendable loading process. Return the current model type
when loading a new model.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Nov 21, 2024
1 parent 0ab393f commit c49047e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ async def load_model_gen(model_path: pathlib.Path, **kwargs):
try:
index = 0
async for module, modules in load_status:
current_model_type = model_type[index].value
if module == 0:
loading_task = progress.add_task(
f"[cyan]Loading {model_type[index].value} modules", total=modules
f"[cyan]Loading {current_model_type} modules", total=modules
)
else:
progress.advance(loading_task)

yield module, modules, model_type
yield module, modules, current_model_type

if module == modules:
# Switch to model progress if the draft model is loaded
Expand Down

0 comments on commit c49047e

Please sign in to comment.