Specify number of parameters
#23
by
BossBoss2021
- opened
Specifying the number of parameters is useful for tech nerds (like me) that want to quickly be able to tell how good a model can be and what the approximate requirements for running it are.
This PR specifies the number of parameters the model has within the introduction.
The number of parameters was counted with the following code snippet:
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained("microsoft/DialoGPT-medium")
total = sum(p.numel() for p in model.parameters())
trainable = sum(p.numel() for p in model.parameters() if p.requires_grad)
print(f"Total: {total:,}\nTrainable: {trainable:,}")
Total: 354,823,168
Trainable: 354,823,168