fix: torch warning of python demo

This commit is contained in:
DominguesAddem1974 2024-04-09 18:17:04 +08:00
parent a22c22b1ee
commit daf1dd81b2

View file

@ -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)