podium icon indicating copy to clipboard operation
podium copied to clipboard

Add lazy module loading

Open mariosasko opened this issue 5 years ago • 1 comments

Discussed this change with @mttk on Slack.

Features:

  • lazy module loading
  • makes it possible to import DiskBackedDataset, HFDatasetConverter and YAKE from the top level __init__.py but only if the required dependencies are installed (pyarrow for DiskBackedDatasets, datasets for HFDatasetConverter, yake for YAKE).

mariosasko avatar Mar 01 '21 21:03 mariosasko

@mttk from podium.datasets import SST, IMDB still works just fine. The import hierarchy is left untouched. I understand what you are saying, but I think the hierarchy is irrelevant to the user and by exposing the public componets in the top level __init__.py , it's easier for the user to reach them.

mariosasko avatar Mar 02 '21 23:03 mariosasko