Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for UI2 model loading not showing progress #392

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modeling/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def _load_state_dict_into_meta_model(

# BEGIN PATCH
utils.bar = tqdm(total=len(state_dict), desc="Loading model tensors", file=utils.UIProgressBarFile(), position=1)
utils.koboldai_vars.total_layers = len(state_dict)

for param_name, param in sorted(
state_dict.items(),
Expand All @@ -216,6 +217,7 @@ def _load_state_dict_into_meta_model(
# Should always be true
param = param.materialize(map_location="cpu")
utils.bar.update(1)
utils.koboldai_vars.loaded_layers += 1
# END PATCH

# First part of the test is always true as load_state_dict_keys always contains state_dict keys.
Expand Down