Sfoglia il codice sorgente

added text_to_sequnce in the hubconf model

gkarch 6 anni fa
parent
commit
362dfe6b3b
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      hubconf.py

+ 3 - 0
hubconf.py

@@ -120,6 +120,7 @@ def nvidia_tacotron2(pretrained=True, **kwargs):
 
     from PyTorch.SpeechSynthesis.Tacotron2.tacotron2 import model as tacotron2
     from PyTorch.SpeechSynthesis.Tacotron2.models import lstmcell_to_float, batchnorm_to_float
+    from PyTorch.SpeechSynthesis.Tacotron2.tacotron2.text import text_to_sequence
 
     fp16 = "model_math" in kwargs and kwargs["model_math"] == "fp16"
     force_reload = "force_reload" in kwargs and kwargs["force_reload"]
@@ -163,6 +164,8 @@ def nvidia_tacotron2(pretrained=True, **kwargs):
     if pretrained:
         m.load_state_dict(state_dict)
 
+    m.text_to_sequence = text_to_sequence
+
     return m