Spaces:
Running
Running
Update modules/speaker.py
Browse files- modules/speaker.py +1 -4
modules/speaker.py
CHANGED
|
@@ -10,9 +10,6 @@ from modules import models
|
|
| 10 |
from modules.utils.SeedContext import SeedContext
|
| 11 |
|
| 12 |
from torch.serialization import add_safe_globals
|
| 13 |
-
|
| 14 |
-
with safe_globals({'modules.speaker.Speaker': Speaker}):
|
| 15 |
-
speaker = torch.load(file_like, map_location="cpu", weights_only=False)
|
| 16 |
|
| 17 |
def create_speaker_from_seed(seed):
|
| 18 |
chat_tts = models.load_chat_tts()
|
|
@@ -25,7 +22,7 @@ class Speaker:
|
|
| 25 |
@staticmethod
|
| 26 |
def from_file(file_like):
|
| 27 |
with safe_globals({'modules.speaker.Speaker': Speaker}):
|
| 28 |
-
speaker = torch.load(file_like, map_location=torch.device("cpu"))
|
| 29 |
speaker.fix()
|
| 30 |
return speaker
|
| 31 |
|
|
|
|
| 10 |
from modules.utils.SeedContext import SeedContext
|
| 11 |
|
| 12 |
from torch.serialization import add_safe_globals
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
def create_speaker_from_seed(seed):
|
| 15 |
chat_tts = models.load_chat_tts()
|
|
|
|
| 22 |
@staticmethod
|
| 23 |
def from_file(file_like):
|
| 24 |
with safe_globals({'modules.speaker.Speaker': Speaker}):
|
| 25 |
+
speaker = torch.load(file_like, map_location=torch.device("cpu"), weights_only=False)
|
| 26 |
speaker.fix()
|
| 27 |
return speaker
|
| 28 |
|