Skip to content

Commit

Permalink
Remove download large file and update readme (Project-MONAI#665)
Browse files Browse the repository at this point in the history
### Description
- Remove download large files to avoid confusion as the large files will
be directly downloaded when download the bundle.
- Set weights_only arg during torch.load to avoid bunch of warning.
- Modify error message to make it clearer.

### Status
**Ready**

### Please ensure all the checkboxes:
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Codeformat tests passed locally by running `./runtests.sh
--codeformat`.
- [ ] In-line docstrings updated.
- [x] Update `version` and `changelog` in `metadata.json` if changing an
existing bundle.
- [ ] Please ensure the naming rules in config files meet our
requirements (please refer to: `CONTRIBUTING.md`).
- [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy`
are correct in `metadata.json`.
- [ ] Descriptions should be consistent with the content, such as
`eval_metrics` of the provided weights and TorchScript modules.
- [ ] Files larger than 25MB are excluded and replaced by providing
download links in `large_file.yml`.
- [ ] Avoid using path that contains personal information within config
files (such as use `/home/your_name/` for `"bundle_root"`).

---------

Signed-off-by: YunLiu <[email protected]>
  • Loading branch information
KumoLiu authored Sep 23, 2024
1 parent 70c1912 commit 9f2177c
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 663 deletions.
10 changes: 5 additions & 5 deletions models/maisi_ct_generative/configs/inference.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,21 @@
"cross_attention_dim": 10
},
"autoencoder": "$@autoencoder_def.to(@device)",
"checkpoint_autoencoder": "$torch.load(@trained_autoencoder_path)",
"checkpoint_autoencoder": "$torch.load(@trained_autoencoder_path, weights_only=True)",
"load_autoencoder": "[email protected]_state_dict(@checkpoint_autoencoder)",
"diffusion_unet": "$@diffusion_unet_def.to(@device)",
"checkpoint_diffusion_unet": "$torch.load(@trained_diffusion_path)",
"checkpoint_diffusion_unet": "$torch.load(@trained_diffusion_path, weights_only=False)",
"load_diffusion": "$@diffusion_unet.load_state_dict(@checkpoint_diffusion_unet['unet_state_dict'])",
"controlnet": "$@controlnet_def.to(@device)",
"copy_controlnet_state": "$monai.networks.utils.copy_model_state(@controlnet, @diffusion_unet.state_dict())",
"checkpoint_controlnet": "$torch.load(@trained_controlnet_path)",
"checkpoint_controlnet": "$torch.load(@trained_controlnet_path, weights_only=False)",
"load_controlnet": "[email protected]_state_dict(@checkpoint_controlnet['controlnet_state_dict'], strict=True)",
"scale_factor": "$@checkpoint_diffusion_unet['scale_factor'].to(@device)",
"mask_generation_autoencoder": "$@mask_generation_autoencoder_def.to(@device)",
"checkpoint_mask_generation_autoencoder": "$torch.load(@trained_mask_generation_autoencoder_path)",
"checkpoint_mask_generation_autoencoder": "$torch.load(@trained_mask_generation_autoencoder_path, weights_only=True)",
"load_mask_generation_autoencoder": "$@mask_generation_autoencoder.load_state_dict(@checkpoint_mask_generation_autoencoder, strict=True)",
"mask_generation_diffusion_unet": "$@mask_generation_diffusion_def.to(@device)",
"checkpoint_mask_generation_diffusion_unet": "$torch.load(@trained_mask_generation_diffusion_path)",
"checkpoint_mask_generation_diffusion_unet": "$torch.load(@trained_mask_generation_diffusion_path, weights_only=True)",
"load_mask_generation_diffusion": "$@mask_generation_diffusion_unet.load_state_dict(@checkpoint_mask_generation_diffusion_unet['unet_state_dict'], strict=True)",
"mask_generation_scale_factor": "$@checkpoint_mask_generation_diffusion_unet['scale_factor']",
"noise_scheduler": {
Expand Down
134 changes: 0 additions & 134 deletions models/maisi_ct_generative/configs/label_dict.json

This file was deleted.

Loading

0 comments on commit 9f2177c

Please sign in to comment.