nip.utils.checkpoints.download_checkpoint

nip.utils.checkpoints.download_checkpoint#

nip.utils.checkpoints.download_checkpoint(wandb_project: str, run_id: str, wandb_entity: str | None = None, wandb_api: Api | None = None, *, include_everything: bool = False, include_rollouts: bool = True, include_processed_transcripts: bool = False, include_raw_transcripts: bool = False, include_prompts: bool = False, handle_existing: Literal['overwrite', 'skip', 'error'] = 'skip')[source]#

Download a checkpoint from wandb to the local checkpoint directory.

Parameters:
  • wandb_project (str) – The project of the wandb run.

  • run_id (str) – The ID of the run to download the checkpoint from.

  • wandb_entity (str, optional) – The entity of the wandb run. If not provided, the default entity will be used.

  • wandb_api (WandbApi, optional) – The wandb API instance to use. If not provided, a new instance will be created.

  • include_everything (bool, default=False) – Whether to download all parts of the checkpoint. If True, all other include_* parameters are ignored.

  • include_rollouts (bool, default=True) – Whether to download rollouts in the checkpoint.

  • include_processed_transcripts (bool, default=False) – Whether to download processed transcripts in the checkpoint.

  • include_raw_transcripts (bool, default=False) – Whether to download raw transcripts in the checkpoint.

  • include_prompts (bool, default=False) – Whether to download prompts in the checkpoint.

  • handle_existing ({"overwrite", "skip", "error"}, default="skip") – What to do if the checkpoint or any files already exist in the local directory. - “overwrite”: overwrite the existing checkpoint. - “skip”: skip downloading the checkpoint. - “error”: raise an error if the checkpoint already exists.

Raises:
  • FileExistsError – If the a requested part of the checkpoint already exists and handle_existing is “error”.

  • ValueError – If no parts of the checkpoint are requested to be downloaded.