Yurii Paniv commited on
Commit
a575152
1 Parent(s): 2cd8140

Add accented text as output

Browse files
Files changed (4) hide show
  1. README.md +2 -1
  2. app.py +1 -1
  3. requirements-local.txt +4 -0
  4. ukrainian_tts/tts.py +1 -1
README.md CHANGED
@@ -61,7 +61,8 @@ from ukrainian_tts.tts import TTS, Voices, StressOption
61
 
62
  tts = TTS()
63
  with open("test.wav", mode="wb") as file:
64
- tts.tts("Привіт", Voices.Olena.value, StressOption.Model.value, file)
 
65
  ```
66
 
67
  ## Run manually:
 
61
 
62
  tts = TTS()
63
  with open("test.wav", mode="wb") as file:
64
+ _, text = tts.tts("Привіт", Voices.Olena.value, StressOption.Model.value, file)
65
+ print("Accented text:", text)
66
  ```
67
 
68
  ## Run manually:
app.py CHANGED
@@ -51,7 +51,7 @@ def tts(text: str, voice: str, stress: str):
51
 
52
 
53
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
54
- ukr_tts.tts(text, speaker_name, autostress_with_model, fp)
55
  return fp.name, text
56
 
57
 
 
51
 
52
 
53
  with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
54
+ _, text = ukr_tts.tts(text, speaker_name, autostress_with_model, fp)
55
  return fp.name, text
56
 
57
 
requirements-local.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # requirements for HuggingFace demo. Installs local package.
2
+ .
3
+ torch==1.12.1
4
+ --extra-index-url https://download.pytorch.org/whl/cu113
ukrainian_tts/tts.py CHANGED
@@ -58,7 +58,7 @@ class TTS:
58
 
59
  output_fp.seek(0)
60
 
61
- return output_fp
62
 
63
 
64
  def __setup_cache(self, cache_folder=None, use_cuda=False):
 
58
 
59
  output_fp.seek(0)
60
 
61
+ return output_fp, text
62
 
63
 
64
  def __setup_cache(self, cache_folder=None, use_cuda=False):