zhzluke96 commited on
Commit
2be0618
1 Parent(s): 7f02ca0
modules/speaker.py CHANGED
@@ -25,7 +25,7 @@ class Speaker:
25
 
26
  @staticmethod
27
  def from_tensor(tensor):
28
- speaker = Speaker(seed=-2)
29
  speaker.emb = tensor
30
  return speaker
31
 
@@ -124,7 +124,9 @@ class SpeakerManager:
124
  ):
125
  if filename == "":
126
  filename = name
127
- speaker = Speaker(seed=-2, name=name, gender=gender, describe=describe)
 
 
128
  if isinstance(tensor, torch.Tensor):
129
  speaker.emb = tensor
130
  if isinstance(tensor, list):
 
25
 
26
  @staticmethod
27
  def from_tensor(tensor):
28
+ speaker = Speaker(seed_or_tensor=-2)
29
  speaker.emb = tensor
30
  return speaker
31
 
 
124
  ):
125
  if filename == "":
126
  filename = name
127
+ speaker = Speaker(
128
+ seed_or_tensor=-2, name=name, gender=gender, describe=describe
129
+ )
130
  if isinstance(tensor, torch.Tensor):
131
  speaker.emb = tensor
132
  if isinstance(tensor, list):
modules/webui/speaker/speaker_creator.py CHANGED
@@ -64,7 +64,7 @@ def create_spk_from_seed(
64
  chat_tts = load_chat_tts()
65
  with SeedContext(seed, True):
66
  emb = chat_tts.sample_random_speaker()
67
- spk = Speaker(seed=-2, name=name, gender=gender, describe=desc)
68
  spk.emb = emb
69
 
70
  with tempfile.NamedTemporaryFile(delete=False, suffix=".pt") as tmp_file:
 
64
  chat_tts = load_chat_tts()
65
  with SeedContext(seed, True):
66
  emb = chat_tts.sample_random_speaker()
67
+ spk = Speaker(seed_or_tensor=-2, name=name, gender=gender, describe=desc)
68
  spk.emb = emb
69
 
70
  with tempfile.NamedTemporaryFile(delete=False, suffix=".pt") as tmp_file: