mirror of
https://github.com/karpathy/nanochat.git
synced 2026-02-17 09:00:22 +00:00
Merge c0618a6b7e into b33e394528
This commit is contained in:
commit
1892bae753
|
|
@ -312,6 +312,7 @@ if __name__ == "__main__":
|
|||
generated_tokens = []
|
||||
torch.cuda.synchronize()
|
||||
t0 = time.time()
|
||||
print(tokenizer.decode(prompt_tokens))
|
||||
stream = model.generate(prompt_tokens, **kwargs)
|
||||
with autocast_ctx:
|
||||
for token in stream:
|
||||
|
|
@ -326,6 +327,7 @@ if __name__ == "__main__":
|
|||
# generate tokens with Engine
|
||||
generated_tokens = []
|
||||
engine = Engine(model, tokenizer)
|
||||
print(tokenizer.decode(prompt_tokens))
|
||||
stream = engine.generate(prompt_tokens, num_samples=1, **kwargs) # note: runs in fp32
|
||||
torch.cuda.synchronize()
|
||||
t0 = time.time()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user