Merge 590fa02792795c78fb8fbdccdc9616d790e0cf4f into 6d51ffceafbf240145619af4c92408a6e54b7924

This commit is contained in:
xuilen 2026-11-12 09:38:57 +08:00 committed by GitHub
commit 21cc9cfd24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 0 deletions

View File

@ -17,6 +17,18 @@ from pytorch_lightning.callbacks import ModelCheckpoint
from pytorch_lightning.loggers import TensorBoardLogger # WandbLogger
from pytorch_lightning.strategies import DDPStrategy
import pathlib
if hasattr(torch.serialization, "add_safe_globals"):
torch.serialization.add_safe_globals([
pathlib.Path,
pathlib.PosixPath,
pathlib.WindowsPath,
pathlib.PurePath,
pathlib.PurePosixPath,
pathlib.PureWindowsPath,
])
logging.getLogger("numba").setLevel(logging.WARNING)
logging.getLogger("matplotlib").setLevel(logging.WARNING)
torch.set_float32_matmul_precision("high")

View File

@ -10,6 +10,17 @@ import traceback
import librosa
import numpy as np
import torch
import pathlib
if hasattr(torch.serialization, "add_safe_globals"):
torch.serialization.add_safe_globals([
pathlib.Path,
pathlib.PosixPath,
pathlib.WindowsPath,
pathlib.PurePath,
pathlib.PurePosixPath,
pathlib.PureWindowsPath,
])
logging.getLogger("numba").setLevel(logging.ERROR)
logging.getLogger("matplotlib").setLevel(logging.ERROR)