openclimatefix / PVNet

PVnet main repo
MIT License
21 stars 5 forks source link

wandb_ids parsing doesn't work in scripts/checkpoint_to_huggingface.py #237

Closed AUdaltsova closed 3 months ago

AUdaltsova commented 4 months ago

Describe the bug

When running scripts/checkpoint_to_huggingface.py without specifying wandb_ids list it trips up on LN55 with TypeError: 'NoneType' object is not subscriptable, because this block that collects wnadb_ids from directory name if wandb_id isn't specified is never entered, as it checks for emptiness via wandb_ids == [], and the default is wandb_ids: Optional[list[str]] = None.

Expected behavior

When wandb_ids is not specified should get it from callback directory path

Suggested fix

change default value to empty list solves it:

wandb_ids: Optional[list[str]] = []