diff --git a/pvnet/models/base_model.py b/pvnet/models/base_model.py index e6e0e907..37210e66 100644 --- a/pvnet/models/base_model.py +++ b/pvnet/models/base_model.py @@ -94,7 +94,7 @@ def minimize_data_config(input_path, output_path, model): if not model.include_nwp: del config["input_data"]["nwp"] else: - for nwp_source in config["input_data"]["nwp"].keys(): + for nwp_source in list(config["input_data"]["nwp"].keys()): nwp_config = config["input_data"]["nwp"][nwp_source] if nwp_source not in model.nwp_encoders_dict: diff --git a/scripts/checkpoint_to_huggingface.py b/scripts/checkpoint_to_huggingface.py index 0005b396..56fd8d97 100644 --- a/scripts/checkpoint_to_huggingface.py +++ b/scripts/checkpoint_to_huggingface.py @@ -2,8 +2,8 @@ use: python checkpoint_to_huggingface.py "path/to/model/checkpoints" \ - --huggingface_repo="openclimatefix/pvnet_uk_region" \ - --wandb_repo="openclimatefix/pvnet2.1"" \ + --huggingface-repo="openclimatefix/pvnet_uk_region" \ + --wandb-repo="openclimatefix/pvnet2.1" \ --local-path="~/tmp/this_model" \ --no-push-to-hub """ @@ -19,10 +19,10 @@ def push_to_huggingface( checkpoint_dir_paths: list[str], huggingface_repo: str = "openclimatefix/pvnet_uk_region", # e.g. openclimatefix/windnet_india - wandb_repo: str | None = "openclimatefix/pvnet2.1", + wandb_repo: str = "openclimatefix/pvnet2.1", val_best: bool = True, - wandb_ids: list[str] | None = [], - local_path: str | None = None, + wandb_ids: list[str] = [], + local_path: str = None, push_to_hub: bool = True, ): """Push a local model to a huggingface model repo