coraKong commited on
Commit
4228841
1 Parent(s): 6045b6b

test DE model

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -4,7 +4,8 @@ from TTS.api import TTS
4
  # Init TTS
5
  tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar = False, gpu=False)
6
  zh_tts = TTS(model_name="tts_models/zh-CN/baker/tacotron2-DDC-GST", progress_bar=False, gpu=False)
7
- de_tts = TTS(model_name = "tts_models/de/thorsten/vits", gpu=False)
 
8
 
9
  def text_to_speech(text: str, speaker_wav, speaker_wav_file, language: str):
10
  if speaker_wav_file and not speaker_wav:
@@ -16,9 +17,9 @@ def text_to_speech(text: str, speaker_wav, speaker_wav_file, language: str):
16
  # else:
17
  zh_tts.tts_to_file(text, file_path=file_path)
18
  elif language == "de":
19
- # if speaker_wav is not None:
20
- # de_tts.tts_to_file(text, speaker_wav=speaker_wav, file_path=file_path)
21
- # else:
22
  de_tts.tts_to_file(text, file_path=file_path)
23
  else:
24
  if speaker_wav is not None:
 
4
  # Init TTS
5
  tts = TTS(model_name="tts_models/multilingual/multi-dataset/your_tts", progress_bar = False, gpu=False)
6
  zh_tts = TTS(model_name="tts_models/zh-CN/baker/tacotron2-DDC-GST", progress_bar=False, gpu=False)
7
+ # de_tts = TTS(model_name = "tts_models/de/thorsten/vits", gpu=False)
8
+ de_tts = TTS(model_name = "tts_models/de/thorsten/tacotron2-DCA", gpu=False)
9
 
10
  def text_to_speech(text: str, speaker_wav, speaker_wav_file, language: str):
11
  if speaker_wav_file and not speaker_wav:
 
17
  # else:
18
  zh_tts.tts_to_file(text, file_path=file_path)
19
  elif language == "de":
20
+ if speaker_wav is not None:
21
+ de_tts.tts_to_file(text, speaker_wav=speaker_wav, file_path=file_path)
22
+ else:
23
  de_tts.tts_to_file(text, file_path=file_path)
24
  else:
25
  if speaker_wav is not None: