Skip to content

Hook for processing input data in LightningCLI #17594

Discussion options

You must be logged in to vote

My recommendation would be that you think of LightningCLI as a class that automatically exposes signature parameters in a CLI. However, the logic to run in most cases is not implemented as part of the CLI class. The parameters come from other classes that you can even use without the CLI.

If you want to load data from a directory, then implement a data module that receives as parameter that directory. This could be a subclass of your module that gets files. Something like:

class FilesData(pl.LightningDataModule):
    def __init__(self, file1, file2, file3):
        super().__init__()
        self._file1 = file1
        self._file2 = file2
        self._file3 = file3

class DirectoryData(F…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@machur
Comment options

Answer selected by machur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment