(url: str)
| 111 | |
| 112 | |
| 113 | def load_model_from_url(url: str) -> Dict[str, torch.Tensor]: |
| 114 | sd_path = load_file_from_url(url, model_dir="weights") |
| 115 | sd = torch.load(sd_path, map_location="cpu") |
| 116 | if "state_dict" in sd: |
| 117 | sd = sd["state_dict"] |
| 118 | if list(sd.keys())[0].startswith("module"): |
| 119 | sd = {k[len("module.") :]: v for k, v in sd.items()} |
| 120 | return sd |
| 121 | |
| 122 | |
| 123 | def sliding_windows( |
no test coverage detected