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: 0 comments
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