From 85e470c30e4b5379dda14cb286b50cf9bc7e5c8b Mon Sep 17 00:00:00 2001 From: odusseys Date: Fri, 22 Nov 2024 18:59:45 +0200 Subject: [PATCH] Fix config loading for jupyter environments (#30) * Fix config loading for jupyter environments The current way of loading config does not work on jupyter environments such as Colab - see https://github.com/eladrich/pyrallis/issues/18 * pre-commit; Signed-off-by: junsongc --------- Signed-off-by: junsongc Co-authored-by: junsongc --- app/sana_pipeline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/sana_pipeline.py b/app/sana_pipeline.py index cfbec8e..cfafe2b 100644 --- a/app/sana_pipeline.py +++ b/app/sana_pipeline.py @@ -77,7 +77,7 @@ def __init__( config: Optional[str] = "configs/sana_config/1024ms/Sana_1600M_img1024.yaml", ): super().__init__() - config = pyrallis.parse(config_class=SanaInference, config_path=config) + config = pyrallis.load(SanaInference, open(config)) self.args = self.config = config # set some hyper-parameters