Gregniuki commited on
Commit
1322116
·
1 Parent(s): 6de6985

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -79,6 +79,7 @@ async def read_root(request: Request):
79
  import json
80
  _LOGGER = logging.getLogger("piper_train.infer_onnx")
81
  import os
 
82
  #if not os.path.exists("./content/piper/src/python/lng"):
83
  # import subprocess
84
  # command = "cp -r ./content/piper/notebooks/lng ./content/piper/src/python/lng"
@@ -265,6 +266,7 @@ async def main(
265
  document.getElementById("loading-message").innerText = "Audio generated successfully!";
266
  document.getElementById("synthesize_button").disabled = false;
267
  </script>
 
268
  """
269
 
270
 
@@ -335,6 +337,7 @@ def phonemize(config, text: str) -> List[List[str]]:
335
  # https://github.com/mush42/libtashkeel/
336
  text = tashkeel_run(text)
337
  return phonemize_espeak(text, config["espeak"]["voice"])
 
338
  if config["phoneme_type"] == PhonemeType.TEXT:
339
  return phonemize_codepoints(text)
340
  raise ValueError(f'Unexpected phoneme type: {config["phoneme_type"]}')
 
79
  import json
80
  _LOGGER = logging.getLogger("piper_train.infer_onnx")
81
  import os
82
+ read_key = os.environ.get('HF_TOKEN', None)
83
  #if not os.path.exists("./content/piper/src/python/lng"):
84
  # import subprocess
85
  # command = "cp -r ./content/piper/notebooks/lng ./content/piper/src/python/lng"
 
266
  document.getElementById("loading-message").innerText = "Audio generated successfully!";
267
  document.getElementById("synthesize_button").disabled = false;
268
  </script>
269
+
270
  """
271
 
272
 
 
337
  # https://github.com/mush42/libtashkeel/
338
  text = tashkeel_run(text)
339
  return phonemize_espeak(text, config["espeak"]["voice"])
340
+
341
  if config["phoneme_type"] == PhonemeType.TEXT:
342
  return phonemize_codepoints(text)
343
  raise ValueError(f'Unexpected phoneme type: {config["phoneme_type"]}')