计算模型参数量的代码:param_count = sum(param.numel() for param in model.parameters())其实model的参数量会全部算的,也就是会加上cin*Conv*cout的参数量,即使你觉得没用上,那只不过这些参数是随机数(pytorch 用He init),没有loss监督,不会被更新而已,但还是会算在你的参数量里 发布于 2020-11-11 12...
trust_remote_code=True,use_fast=False)eval_tokenizer.pad_token=eval_tokenizer.eos_tokendefgen(model,p,maxlen=100,sample=True):toks=eval_tokenizer(p,return_tensors="pt")res=model.generate(**toks.to("cuda"),max_new_tokens=maxlen,do_sample=sample,num_return_sequences=1,temperature=0.1,num...
Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up {...