Is there a way to instantiate a Lightning Module class using a class method on Lightning CLI? #19863
Unanswered
carlesoctav
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 9 replies
-
With jsonargparse v4.30.0 just released, now it is possible to give in It will not be allowed to have functions without the return type annotation, because this would be vulnerability, since it would become possible to execute any function. But note, it shouldn't be too difficult to contribute required changes to transformers. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to instantiate a Lightning Module class using a class method on Lightning CLI? This problem arises when I try to create a model class that inherits from LightningModule and Huggingface's PretrainedModel Class. We all know that the PretrainedModel class uses the from_pretrained class method to instantiate a model loaded from the Huggingface hub. When I try to use LightningCLI, we all know that it will attempt to instantiate the instance with the init method.
Beta Was this translation helpful? Give feedback.
All reactions