Apply ruff flake8-comprehensions (#21694)
This commit is contained in:
@@ -407,7 +407,7 @@ def main():
|
||||
)
|
||||
else:
|
||||
model = AutoModelForCausalLM.from_config(config)
|
||||
n_params = sum(dict((p.data_ptr(), p.numel()) for p in model.parameters()).values())
|
||||
n_params = sum({p.data_ptr(): p.numel() for p in model.parameters()}.values())
|
||||
logger.info(f"Training new model from scratch - Total size={n_params/2**20:.2f}M params")
|
||||
|
||||
# We resize the embeddings only when necessary to avoid index errors. If you are creating a model from scratch
|
||||
|
||||
Reference in New Issue
Block a user