From 305d920862dd3f8a989d2f1132fb40c775c3c29a Mon Sep 17 00:00:00 2001 From: Michael Cusack Date: Fri, 4 Aug 2023 17:33:23 +0700 Subject: [PATCH] Zero'ing params docs --- save_model.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/save_model.py b/save_model.py index 921d227..42bcd06 100644 --- a/save_model.py +++ b/save_model.py @@ -6,10 +6,10 @@ inference with: #include torch::jit::Module module = torch::jit::load("model.pt") -Note that the model includes the initial parameters and with default ModelArgs the -serialized model is 59M and gzips down to 55M. If you want to serialize/distribute the -model parameters separately and the size of the model file you can zero out the -parameters before saving it and it will gzip down to 780K: +Note that the serialized model includes the initial parameters and with the default +ModelArgs the file is 59M and gzips down to 55M. If you want to serialize/distribute +the model parameters separately and you can zero out the parameters before saving it +and it will gzip down to 780K: for p in model.parameters(): p.detach().zero_() """