Add support for loading additional checkpoint classes in PyTorch
This commit is contained in:
7
main.py
7
main.py
@@ -18,7 +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
|
||||||
add_safe_globals([TorchVersion])
|
from pyannote.audio.core.task import Specifications
|
||||||
|
|
||||||
|
# allowloading checkpoints that store these classes (PyTorch 2.6+ weights_only change)
|
||||||
|
add_safe_globals([TorchVersion, Specifications])
|
||||||
|
|
||||||
# --- 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:
|
||||||
@@ -235,4 +238,4 @@ subprocess.run([
|
|||||||
"dubbed_output.mp4"
|
"dubbed_output.mp4"
|
||||||
], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
console.print("\n✅ Magyar AI dub kész: dubbed_output.mp4")
|
console.print("\n✅ Magyar AI dub kész: dubbed_output.mp4")
|
||||||
|
|||||||
Reference in New Issue
Block a user