Explorar o código

added text_to_sequnce in the hubconf model

gkarch %!s(int64=6) %!d(string=hai) anos
pai
achega
362dfe6b3b
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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