X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=pytorch.git;a=blobdiff_plain;f=gpt-test.py;h=096704334c2e89e4af94c28afefccf757fc91f3d;hp=557f7345b4042ac1ad34cdc06306382199598489;hb=67d11b3a33f37a394f43e30b230e658c1398edee;hpb=f1871f4050267445107c35f9e376b8e21d021dc9 diff --git a/gpt-test.py b/gpt-test.py index 557f734..0967043 100755 --- a/gpt-test.py +++ b/gpt-test.py @@ -53,6 +53,8 @@ tokenizer = GPT2Tokenizer.from_pretrained(model_name) model = GPT2LMHeadModel.from_pretrained(model_name) model.eval() +print(f'Using {model_name} ({int(sum(p.numel() for p in model.parameters())/(1e6))}M parameters)') + print( complete(model, tokenizer, 'The object was blue all over, but also green all over, it was a',