From 742ef1c5648f8a0b00a08db42dd41f55f7d122c9 Mon Sep 17 00:00:00 2001 From: odusseys Date: Fri, 22 Nov 2024 17:31:40 +0200 Subject: [PATCH 1/2] 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 --- app/sana_pipeline.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/sana_pipeline.py b/app/sana_pipeline.py index cfbec8e..43417ae 100644 --- a/app/sana_pipeline.py +++ b/app/sana_pipeline.py @@ -77,7 +77,8 @@ def __init__( config: Optional[str] = "configs/sana_config/1024ms/Sana_1600M_img1024.yaml", ): super().__init__() - config = pyrallis.parse(config_class=SanaInference, config_path=config) + with open(config) as cf: + config = pyrallis.load(SanaInference, f) self.args = self.config = config # set some hyper-parameters From f71fb92faff6fb8e49f61d94a7eac3714065328a Mon Sep 17 00:00:00 2001 From: junsongc Date: Sat, 23 Nov 2024 00:22:09 +0800 Subject: [PATCH 2/2] pre-commit; Signed-off-by: junsongc --- app/sana_pipeline.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/sana_pipeline.py b/app/sana_pipeline.py index 43417ae..cfafe2b 100644 --- a/app/sana_pipeline.py +++ b/app/sana_pipeline.py @@ -77,8 +77,7 @@ def __init__( config: Optional[str] = "configs/sana_config/1024ms/Sana_1600M_img1024.yaml", ): super().__init__() - with open(config) as cf: - config = pyrallis.load(SanaInference, f) + config = pyrallis.load(SanaInference, open(config)) self.args = self.config = config # set some hyper-parameters