pykara commited on
Commit
d2aac79
·
1 Parent(s): 5875a95
Files changed (1) hide show
  1. ragg/app.py +8 -1
ragg/app.py CHANGED
@@ -79,8 +79,15 @@ def xtts_speak_to_file(
79
  f"{reference_files or []} and/or {reference_dir}"
80
  )
81
 
 
 
82
  if not hasattr(xtts_speak_to_file, "_model") or xtts_speak_to_file._model is None:
83
- xtts_speak_to_file._model = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=False)
 
 
 
 
 
84
  tts = xtts_speak_to_file._model
85
 
86
  out_path = Path(out_file) if out_file else Path(f"xtts_{uuid.uuid4().hex}.wav")
 
79
  f"{reference_files or []} and/or {reference_dir}"
80
  )
81
 
82
+ # if not hasattr(xtts_speak_to_file, "_model") or xtts_speak_to_file._model is None:
83
+ # xtts_speak_to_file._model = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=False)
84
  if not hasattr(xtts_speak_to_file, "_model") or xtts_speak_to_file._model is None:
85
+ import sys
86
+ sys.stdin = open(os.devnull) # prevent EOF crash (no terminal input)
87
+ xtts_speak_to_file._model = TTS(
88
+ "tts_models/multilingual/multi-dataset/xtts_v2",
89
+ gpu=False,
90
+ )
91
  tts = xtts_speak_to_file._model
92
 
93
  out_path = Path(out_file) if out_file else Path(f"xtts_{uuid.uuid4().hex}.wav")