Skip to content

Commit

Permalink
Whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
cg123 committed Nov 30, 2024
1 parent 3a1ea54 commit 74e2b72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mergekit/scripts/tokensurgeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ def main(
cosine_similarity=cosine_similarity,
name=lm_head_info.name,
)
else:
new_lm_head = None

# Save out the new model
LOG.info(f"Saving new model to {out_path}")
Expand All @@ -198,6 +200,10 @@ def main(
tensor = cache.get(model).get_tensor(
weight_info.name, aliases=weight_info.aliases
)
if tensor is None:
if weight_info.optional:
continue
report_issue(f"Could not load weight tensor {weight_info.name}", error=True)
writer.save_tensor(weight_info.name, tensor, clone=merge_options.clone_tensors)
writer.finalize()

Expand Down

0 comments on commit 74e2b72

Please sign in to comment.