This commit is contained in:
Jong Wook Kim 2024-06-11 15:40:38 +03:00 committed by GitHub
commit 9a7f0d8679
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -133,6 +133,7 @@ def load(name: str, device: Union[str, torch.device] = "cuda" if torch.cuda.is_a
if jit: if jit:
warnings.warn(f"File {model_path} is not a JIT archive. Loading as a state dict instead") warnings.warn(f"File {model_path} is not a JIT archive. Loading as a state dict instead")
jit = False jit = False
opened_file.seek(0)
state_dict = torch.load(opened_file, map_location="cpu") state_dict = torch.load(opened_file, map_location="cpu")
if not jit: if not jit: