mirror of
https://github.com/karpathy/llm.c.git
synced 2026-07-28 20:35:09 -04:00
fix: torch warning of python demo
This commit is contained in:
parent
a22c22b1ee
commit
daf1dd81b2
1 changed files with 1 additions and 1 deletions
|
|
@ -330,7 +330,7 @@ if __name__ == "__main__":
|
|||
tokens = np.frombuffer(f.read(), dtype=np.int32)
|
||||
|
||||
# np -> tensor, long, on device
|
||||
tokens = torch.from_numpy(tokens)
|
||||
tokens = torch.tensor(tokens)
|
||||
tokens = tokens.to(torch.long)
|
||||
tokens = tokens.to(device)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue