Skip to content

Commit

Permalink
Ignore None values in converter
Browse files Browse the repository at this point in the history
  • Loading branch information
2015aroras committed Oct 29, 2024
1 parent 30844ec commit 75dabae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/transformers/models/olmo/convert_olmo_weights_to_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def write_model(
state_dict[f"model.layers.{layer_i}.self_attn.rotary_emb.inv_freq"] = inv_freq

for k, v in state_dict.items():
if v is None:
continue
index_dict["weight_map"][k] = filename
param_count += v.numel()
torch.save(state_dict, os.path.join(tmp_model_path, filename))
Expand All @@ -153,6 +155,8 @@ def write_model(
}

for k, v in state_dict.items():
if v is None:
continue
index_dict["weight_map"][k] = filename
param_count += v.numel()
torch.save(state_dict, os.path.join(tmp_model_path, filename))
Expand Down

0 comments on commit 75dabae

Please sign in to comment.