mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2026-04-10 12:33:42 +00:00
committed by
GitHub
parent
6cbe6520a2
commit
08040f024c
@@ -239,4 +239,4 @@ if __name__ == "__main__":
|
||||
# Save and load model
|
||||
torch.save(model.state_dict(), "model.pth")
|
||||
model = GPTModel(GPT_CONFIG_124M)
|
||||
model.load_state_dict(torch.load("model.pth"))
|
||||
model.load_state_dict(torch.load("model.pth"), weights_only=True)
|
||||
|
||||
Reference in New Issue
Block a user