diff --git a/helpers/training/trainer.py b/helpers/training/trainer.py index b957f3d6..8c641dd6 100644 --- a/helpers/training/trainer.py +++ b/helpers/training/trainer.py @@ -2987,7 +2987,7 @@ def train(self): } if self.grad_norm is not None: if self.config.grad_clip_method == "norm": - logs["grad_norm"] = self.grad_norm + logs["grad_norm"] = float(self.grad_norm.clone().detach()) elif self.config.grad_clip_method == "value": logs["grad_absmax"] = self.grad_norm diff --git a/install/apple/poetry.lock b/install/apple/poetry.lock index ce548dac..c09f3fc5 100644 --- a/install/apple/poetry.lock +++ b/install/apple/poetry.lock @@ -1776,7 +1776,7 @@ numpy = [ [[package]] name = "optimum-quanto" -version = "0.2.5.dev0" +version = "0.2.6.dev0" description = "A pytorch quantization backend for optimum." optional = false python-versions = ">=3.9.0" @@ -1791,14 +1791,14 @@ safetensors = "*" torch = ">=2.4.0" [package.extras] -dev = ["black", "pytest", "ruff"] +dev = ["pytest", "ruff"] examples = ["accelerate", "datasets", "diffusers", "scipy", "sentencepiece", "torchvision", "transformers"] [package.source] type = "git" url = "https://github.com/huggingface/optimum-quanto" reference = "HEAD" -resolved_reference = "194150f384ae9244dd4eb86994f6c510200663f9" +resolved_reference = "66dca87bc7e61ffbf1a06da9fd324469592e17e9" [[package]] name = "packaging"