diff --git a/.gitignore b/.gitignore
index 67f3f28..a9bdd6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@ __pycache__/
/build/
/.venv/
/dist/
-/local/
\ No newline at end of file
+*.onnx
\ No newline at end of file
diff --git a/MANIFEST.in b/MANIFEST.in
index 381e212..7494950 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,4 +2,4 @@ include requirements.txt
include requirements_dev.txt
include LICENSE
include README.md
-include VERSION
+include larynx/VERSION
diff --git a/bin/make_sample_html.py b/bin/make_sample_html.py
index c12966f..97e9370 100755
--- a/bin/make_sample_html.py
+++ b/bin/make_sample_html.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import sys
+from collections import defaultdict
from pathlib import Path
@@ -12,9 +13,13 @@ def main():
print('
Larynx Voice Samples')
print("")
print("Larynx Voice Samples
")
+ print('Voices samples trained for Larynx.
')
local_dir = Path(sys.argv[1])
+ # language -> voice name -> samples dir
+ voices = defaultdict(dict)
+
# local//-
for lang_dir in sorted(Path(local_dir).iterdir()):
if not lang_dir.is_dir():
@@ -26,8 +31,6 @@ def main():
# Exclude vocoders
continue
- print("", language, "
")
-
for voice_dir in sorted(lang_dir.iterdir()):
if not voice_dir.is_dir():
continue
@@ -42,8 +45,37 @@ def main():
print("Missing", test_sentences, file=sys.stderr)
continue
- voice, model_type = voice_dir.name.split("-", maxsplit=1)
- print("", voice, f"({model_type})", "
")
+ voices[language][voice_dir.name] = samples_dir
+
+ # Print table of contents
+ print("")
+ for language, lang_voices in voices.items():
+ print("- ", f'', language, "")
+
+ print("")
+
+ print("
")
+
+ print("
")
+ print("
")
+
+ # Print samples
+ for language, lang_voices in voices.items():
+ print(f'', language, "
")
+
+ for voice_name, samples_dir in lang_voices.items():
+ test_sentences = samples_dir / "test_sentences.txt"
+ voice, model_type = voice_name.split("-", maxsplit=1)
+ print(f'', voice, f"({model_type})", "
")
with open(test_sentences, "r") as test_sentences_file:
for line in sorted(test_sentences_file):
diff --git a/VERSION b/larynx/VERSION
similarity index 100%
rename from VERSION
rename to larynx/VERSION
diff --git a/larynx/__init__.py b/larynx/__init__.py
index fe19801..e538eb4 100644
--- a/larynx/__init__.py
+++ b/larynx/__init__.py
@@ -23,6 +23,10 @@
_LOGGER = logging.getLogger("larynx")
+_DIR = Path(__file__).parent
+
+__version__ = (_DIR / "VERSION").read_text().strip()
+
# -----------------------------------------------------------------------------
diff --git a/larynx/__main__.py b/larynx/__main__.py
index b37e597..b30284e 100644
--- a/larynx/__main__.py
+++ b/larynx/__main__.py
@@ -247,9 +247,9 @@ def main():
def get_args():
"""Parse command-line arguments"""
- parser = argparse.ArgumentParser(prog="larynx-runtime")
+ parser = argparse.ArgumentParser(prog="larynx")
parser.add_argument(
- "--language", required=True, help="Gruut language for text input"
+ "--language", required=True, help="Gruut language for text input (en-us, etc.)"
)
parser.add_argument(
"text", nargs="*", help="Text to convert to speech (default: stdin)"
diff --git a/setup.py b/setup.py
index 485e390..879a690 100644
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,7 @@
import setuptools
this_dir = Path(__file__).parent
+module_dir = this_dir / "larynx"
# -----------------------------------------------------------------------------
@@ -20,7 +21,7 @@
with open(requirements_path, "r") as requirements_file:
requirements = requirements_file.read().splitlines()
-version_path = this_dir / "VERSION"
+version_path = module_dir / "VERSION"
with open(version_path, "r") as version_file:
version = version_file.read().strip()
@@ -34,7 +35,7 @@
author_email="mike@rhasspy.org",
url="https://github.com/rhasspy/larynx",
packages=setuptools.find_packages(),
- package_data={"larynx": ["py.typed"]},
+ package_data={"larynx": ["VERSION", "py.typed"]},
install_requires=requirements,
entry_points={"console_scripts": ["larynx = larynx.__main__:main"]},
classifiers=[