-
Currently I'm doing a full copy of the entire model instead of just the LoRA. Would be great to not have to do this. Maybe if there was a way to easily get only the LoRA weights in a I normally use Is there an intended way of doing this that I've just missed? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Just did a quick glance. I think the issue is this: Here, all parameters are used and there is no way on the PEFT side that we could prevent this. There is a filter for Not sure if lucidrains accepts PRs, but you could try to suggest adding a - self.parameter_names = {name for name, param in self.ema_model.named_parameters() if param.dtype in [torch.float, torch.float16]}
+ self.parameter_names = {name for name, param in self.ema_model.named_parameters() if param.dtype in [torch.float, torch.float16] and filter_fn(name)} |
Beta Was this translation helpful? Give feedback.
-
I ended up using a wrapper that keeps track of all the trained parameters.
This can then just be given to the EMA like this:
And you can load the trainables state dict into the original model because it has the same structure.
I feel like I've ran into problems related of not being able to access the PEFT part model twice in a short time because it is always injected or part of the larger model. |
Beta Was this translation helpful? Give feedback.
I ended up using a wrapper that keeps track of all the trained parameters.