Skip to content

Commit

Permalink
fixes before first PyPI release
Browse files Browse the repository at this point in the history
  • Loading branch information
erogol committed Jan 25, 2021
1 parent 58f6b34 commit 60c1bb9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,21 @@ Some of the public datasets that we successfully applied TTS:

## Example: Synthesizing Speech on Terminal Using the Released Models.

TTS provides a CLI interface for synthesizing speech using pre-trained models. You can either use your own model or the release models under the TTS project.
After the installation, TTS provides a CLI interface for synthesizing speech using pre-trained models. You can either use your own model or the release models under the TTS project.

Listing released TTS models.
```./TTS/bin/synthesize.py --list_models```
```tts --list_models```

Run a tts and a vocoder model from the released model list. (Simply copy and paste the full model names from the list as arguments for the command below.)
```./TTS/bin/synthesize.py --text "Text for TTS" --model_name "<type>/<language>/<dataset>/<model_name>" --vocoder_name "<type>/<language>/<dataset>/<model_name>" --output_path```
```tts --text "Text for TTS" --model_name "<type>/<language>/<dataset>/<model_name>" --vocoder_name "<type>/<language>/<dataset>/<model_name>" --output_path```

Run your own TTS model (Using Griffin-Lim Vocoder)
```./TTS/bin/synthesize.py --text "Text for TTS" --model_path path/to/model.pth.tar --config_path path/to/config.json --out_path output/path/speech.wav```
```tts --text "Text for TTS" --model_path path/to/model.pth.tar --config_path path/to/config.json --out_path output/path/speech.wav```

Run your own TTS and Vocoder models
```./TTS/bin/synthesize.py --text "Text for TTS" --model_path path/to/config.json --config_path path/to/model.pth.tar --out_path output/path/speech.wav --vocoder_path path/to/vocoder.pth.tar --vocoder_config_path path/to/vocoder_config.json```
```tts --text "Text for TTS" --model_path path/to/config.json --config_path path/to/model.pth.tar --out_path output/path/speech.wav --vocoder_path path/to/vocoder.pth.tar --vocoder_config_path path/to/vocoder_config.json```

**Note:** You can use ```./TTS/bin/synthesize.py``` if you prefer running ```tts``` from the TTS project folder.

## Example: Training and Fine-tuning LJ-Speech Dataset
Here you can find a [CoLab](https://gist.github.com/erogol/97516ad65b44dbddb8cd694953187c5b) notebook for a hands-on example, training LJSpeech. Or you can manually follow the guideline below.
Expand Down
6 changes: 5 additions & 1 deletion TTS/bin/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def str2bool(v):
raise argparse.ArgumentTypeError('Boolean value expected.')


if __name__ == "__main__":
def main():
# pylint: disable=bad-continuation
parser = argparse.ArgumentParser(description='''Synthesize speech on command line.\n\n'''

Expand Down Expand Up @@ -216,3 +216,7 @@ def str2bool(v):
out_path = os.path.join(args.out_path, file_name)
print(" > Saving output to {}".format(out_path))
synthesizer.save_wav(wav, out_path)


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions TTS/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Instructions below are based on a Ubuntu 18.04 machine, but it should be simple
##### Using server.py
If you have the environment set already for TTS, then you can directly call ```server.py```.

**Note:** After installing TTS as a package you can use ```tts-server``` to call the commands below.

Examples runs:

List officially released models.
Expand Down
39 changes: 20 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,8 @@ def cythonize(*args, **kwargs): #pylint: disable=redefined-outer-name
# Remove our arguments from argv so that setuptools doesn't see them
sys.argv = [sys.argv[0]] + unknown_args

version = '0.0.9'

# Adapted from https://github.com/pytorch/pytorch
version = '0.0.9a0'
cwd = os.path.dirname(os.path.abspath(__file__))
if os.getenv('TTS_PYTORCH_BUILD_VERSION'):
version = os.getenv('TTS_PYTORCH_BUILD_VERSION')
else:
try:
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
cwd=cwd).decode('ascii').strip()
version += '+' + sha[:7]
except subprocess.CalledProcessError:
pass
except IOError: # FileNotFoundError for python 3
pass


# Handle Cython code
def find_pyx(path='.'):
Expand Down Expand Up @@ -108,18 +94,20 @@ def pip_install(package_name):
reqs_from_file = open('requirements.txt').readlines()
# reqs_without_tf = [r for r in reqs_from_file if not r.startswith('tensorflow')]
# tf_req = [r for r in reqs_from_file if r.startswith('tensorflow')]

# requirements = {'install_requires': reqs_without_tf, 'pip_install': tf_req}

with open('README.md', "r", encoding="utf-8") as readme_file:
README = readme_file.read()

setup(
name='TTS',
version=version,
url='https://github.com/mozilla/TTS',
author='Eren Gölge',
author_email='egolge@mozilla.com',
description='Text to Speech with Deep Learning',
# long_description=README,
license='MPL-2.0',
entry_points={'console_scripts': ['tts-server = TTS.server.server:main']},
ext_modules=find_cython_extensions(),
packages=find_packages(include=['TTS*']),
project_urls={
Expand All @@ -134,17 +122,30 @@ def pip_install(package_name):
},
install_requires=reqs_from_file,
python_requires='>=3.6.0',
entry_points={
'console_scripts': [
'tts=TTS.bin.synthesize:main',
'tts-server = TTS.server.server:main'
]
},
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
'Development Status :: 3 - Alpha',
"Intended Audience :: Science/Research :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Operating System :: POSIX :: Linux",
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
"Topic :: Software Development :: Libraries :: Python Modules :: Speech :: Sound/Audio :: Multimedia :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Multimedia :: Sound/Audio :: Speech",
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Multimedia",
"Topic :: Scientific/Engineering :: Artificial Intelligence"
])

# for some reason having tensorflow in 'install_requires'
Expand Down

0 comments on commit 60c1bb9

Please sign in to comment.