PyThaiTTS 0.4.0__tar.gz → 0.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyThaiTTS
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Open Source Thai Text-to-speech library in Python
5
5
  Home-page: https://github.com/pythainlp/pythaitts
6
6
  Author: Wannaphong
@@ -25,6 +25,7 @@ Requires-Dist: huggingface_hub
25
25
  Requires-Dist: numpy>=1.22
26
26
  Requires-Dist: onnxruntime
27
27
  Requires-Dist: vachanatts
28
+ Requires-Dist: soundfile
28
29
  Dynamic: author
29
30
  Dynamic: author-email
30
31
  Dynamic: classifier
@@ -51,7 +52,9 @@ License: [Apache-2.0 License](https://github.com/PyThaiNLP/pythaitts/blob/main/L
51
52
 
52
53
  Install by pip:
53
54
 
54
- > pip install pythaitts
55
+ ```sh
56
+ pip install pythaitts
57
+ ```
55
58
 
56
59
  ## Usage
57
60
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyThaiTTS
3
- Version: 0.4.0
3
+ Version: 0.4.2
4
4
  Summary: Open Source Thai Text-to-speech library in Python
5
5
  Home-page: https://github.com/pythainlp/pythaitts
6
6
  Author: Wannaphong
@@ -25,6 +25,7 @@ Requires-Dist: huggingface_hub
25
25
  Requires-Dist: numpy>=1.22
26
26
  Requires-Dist: onnxruntime
27
27
  Requires-Dist: vachanatts
28
+ Requires-Dist: soundfile
28
29
  Dynamic: author
29
30
  Dynamic: author-email
30
31
  Dynamic: classifier
@@ -51,7 +52,9 @@ License: [Apache-2.0 License](https://github.com/PyThaiNLP/pythaitts/blob/main/L
51
52
 
52
53
  Install by pip:
53
54
 
54
- > pip install pythaitts
55
+ ```sh
56
+ pip install pythaitts
57
+ ```
55
58
 
56
59
  ## Usage
57
60
 
@@ -2,3 +2,4 @@ huggingface_hub
2
2
  numpy>=1.22
3
3
  onnxruntime
4
4
  vachanatts
5
+ soundfile
@@ -10,7 +10,9 @@ License: [Apache-2.0 License](https://github.com/PyThaiNLP/pythaitts/blob/main/L
10
10
 
11
11
  Install by pip:
12
12
 
13
- > pip install pythaitts
13
+ ```sh
14
+ pip install pythaitts
15
+ ```
14
16
 
15
17
  ## Usage
16
18
 
@@ -2,7 +2,7 @@
2
2
  """
3
3
  PyThaiTTS
4
4
  """
5
- __version__ = "0.3.0"
5
+ __version__ = "0.4.2"
6
6
 
7
7
  from pythaitts.preprocess import preprocess_text, num_to_thai, expand_maiyamok
8
8
 
@@ -21,6 +21,7 @@ class TTS:
21
21
 
22
22
  You can see more about khanomtan tts at `https://github.com/wannaphong/KhanomTan-TTS-v1.0 <https://github.com/wannaphong/KhanomTan-TTS-v1.0>`_
23
23
  and `https://github.com/wannaphong/KhanomTan-TTS-v1.1 <https://github.com/wannaphong/KhanomTan-TTS-v1.1>`_
24
+ If you want to use khanomtan tts, you must to install coqui-tts before use the model by pip install coqui-tts.
24
25
 
25
26
  For lunarlist tts model, you must to install nemo before use the model by pip install nemo_toolkit['tts'].
26
27
  You can see more about lunarlist tts at `https://link.medium.com/OpPjQis6wBb <https://link.medium.com/OpPjQis6wBb>`_
@@ -47,28 +47,22 @@ class KhanomTan:
47
47
  if mode=="best_model":
48
48
  self.best_model_path = hf_hub_download(repo_id="wannaphong/khanomtan-tts-v{0}".format(self.version),filename=self.best_model_path_name,force_filename="best_model-v{0}.pth".format(self.version))
49
49
  self.synthesizer = Synthesizer(
50
- self.best_model_path,
51
- self.config_path,
52
- self.speakers_path,
53
- self.languages_path,
54
- None,
55
- None,
56
- self.speaker_encoder_model_path,
57
- self.speaker_encoder_config_path,
58
- False
50
+ tts_checkpoint=self.best_model_path,
51
+ tts_config_path=self.config_path,
52
+ tts_speakers_file=self.speakers_path,
53
+ tts_languages_file=self.languages_path,
54
+ encoder_checkpoint=self.speaker_encoder_model_path,
55
+ encoder_config=self.speaker_encoder_config_path
59
56
  )
60
57
  else:
61
58
  self.last_checkpoint_model_path = hf_hub_download(repo_id="wannaphong/khanomtan-tts-v{0}".format(self.version),filename=self.last_checkpoint_model_path_name,force_filename="last_checkpoint-v{0}.pth".format(self.version))
62
59
  self.synthesizer = Synthesizer(
63
- self.last_checkpoint_model_path,
64
- self.config_path,
65
- self.speakers_path,
66
- self.languages_path,
67
- None,
68
- None,
69
- self.speaker_encoder_model_path,
70
- self.speaker_encoder_config_path,
71
- False
60
+ tts_checkpoint=self.last_checkpoint_model_path,
61
+ tts_config_path=self.config_path,
62
+ tts_speakers_file=self.speakers_path,
63
+ tts_languages_file=self.languages_path,
64
+ encoder_checkpoint=self.speaker_encoder_model_path,
65
+ encoder_config=self.speaker_encoder_config_path
72
66
  )
73
67
  def __call__(self, text: str, speaker_idx: str, language_idx: str, return_type: str = "file", filename: str = None):
74
68
  wavs = self.synthesizer.tts(text, speaker_idx, language_idx)
@@ -76,8 +70,8 @@ class KhanomTan:
76
70
  return wavs
77
71
  if filename != None:
78
72
  with open(filename, "wb") as fp:
79
- self.synthesizer.save_wav(wavs, fp)
73
+ self.synthesizer.save_wav(wavs, path=filename)
80
74
  else:
81
- with tempfile.NamedTemporaryFile(suffix = ".wav", delete = False) as fp:
82
- self.synthesizer.save_wav(wavs, fp)
83
- return fp.name
75
+ filename= tempfile.NamedTemporaryFile(suffix = ".wav", delete = False).name
76
+ self.synthesizer.save_wav(wavs, path=filename)
77
+ return filename
@@ -9,7 +9,7 @@ with open("requirements.txt","r",encoding="utf-8-sig") as f:
9
9
 
10
10
  setup(
11
11
  name="PyThaiTTS",
12
- version="0.4.0",
12
+ version="0.4.2",
13
13
  description="Open Source Thai Text-to-speech library in Python",
14
14
  long_description=readme,
15
15
  long_description_content_type="text/markdown",
File without changes
File without changes
File without changes