Add Resolution class to safe globals for checkpoint loading in PyTorch

This commit is contained in:
2025-11-30 21:43:20 +01:00
parent 69154bb998
commit acf733fb3d

View File

@@ -18,10 +18,10 @@ console = Console()
# --- Safe-global engedélyezés TorchVersion számára (checkpoint hack) --- # --- Safe-global engedélyezés TorchVersion számára (checkpoint hack) ---
from torch.serialization import add_safe_globals from torch.serialization import add_safe_globals
from torch.torch_version import TorchVersion from torch.torch_version import TorchVersion
from pyannote.audio.core.task import Specifications, Problem from pyannote.audio.core.task import Specifications, Problem, Resolution
# allowloading checkpoints that store these classes (PyTorch 2.6+ weights_only change) # allowloading checkpoints that store these classes (PyTorch 2.6+ weights_only change)
add_safe_globals([TorchVersion, Specifications, Problem]) add_safe_globals([TorchVersion, Specifications, Problem, Resolution])
# --- FFmpeg és Whisper a saját rendszered pipeline-jához, HF Token kötelező --- # --- FFmpeg és Whisper a saját rendszered pipeline-jához, HF Token kötelező ---
if len(sys.argv) < 2: if len(sys.argv) < 2: