Skip to content

Commit 5ef3fef

Browse files
committed
Meta -> cpu for uninitialized weights
1 parent 697a2cc commit 5ef3fef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/models/llama/model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ def __init__(self, **kwargs):
251251
"Could not load checkpoint into mode, defaulting to random uninitialized weights."
252252
)
253253
print(f"Error: {e}")
254+
self.model_.to_empty(device="cpu")
254255

255256
if missing:
256257
missing_weights = [fqn for fqn in missing if fqn.endswith(".weight")]

0 commit comments

Comments
 (0)