Skip to content

Commit

Permalink
model checkpoint bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfulu committed Oct 7, 2024
1 parent 1ec1561 commit 5904d2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pvnet/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions scripts/checkpoint_to_huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand All @@ -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
Expand Down

0 comments on commit 5904d2e

Please sign in to comment.