mirror of https://github.com/coqui-ai/TTS.git
style: run pre-commit
Automatic changes from: pre-commit run --all-files
This commit is contained in:
parent
5cf1d41555
commit
ec50006855
|
@ -15,4 +15,3 @@ markComment: >
|
||||||
for your contributions. You might also look our discussion channels.
|
for your contributions. You might also look our discussion channels.
|
||||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
closeComment: false
|
closeComment: false
|
||||||
|
|
||||||
|
|
|
@ -41,4 +41,3 @@ COPY . /root
|
||||||
|
|
||||||
# Installing the TTS package itself:
|
# Installing the TTS package itself:
|
||||||
RUN make install
|
RUN make install
|
||||||
|
|
||||||
|
|
|
@ -14,15 +14,15 @@ import importlib.metadata
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath('../..'))
|
sys.path.insert(0, os.path.abspath("../.."))
|
||||||
|
|
||||||
# mock deps with system level requirements.
|
# mock deps with system level requirements.
|
||||||
autodoc_mock_imports = ["soundfile"]
|
autodoc_mock_imports = ["soundfile"]
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
project = 'TTS'
|
project = "TTS"
|
||||||
copyright = "2021 Coqui GmbH, 2020 TTS authors"
|
copyright = "2021 Coqui GmbH, 2020 TTS authors"
|
||||||
author = 'Coqui GmbH'
|
author = "Coqui GmbH"
|
||||||
|
|
||||||
# The version info for the project you're documenting, acts as replacement for
|
# The version info for the project you're documenting, acts as replacement for
|
||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
|
@ -38,32 +38,34 @@ master_doc = "index"
|
||||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
# ones.
|
# ones.
|
||||||
extensions = [
|
extensions = [
|
||||||
'sphinx.ext.autodoc',
|
"sphinx.ext.autodoc",
|
||||||
'sphinx.ext.autosummary',
|
"sphinx.ext.autosummary",
|
||||||
'sphinx.ext.doctest',
|
"sphinx.ext.doctest",
|
||||||
'sphinx.ext.intersphinx',
|
"sphinx.ext.intersphinx",
|
||||||
'sphinx.ext.todo',
|
"sphinx.ext.todo",
|
||||||
'sphinx.ext.coverage',
|
"sphinx.ext.coverage",
|
||||||
'sphinx.ext.napoleon',
|
"sphinx.ext.napoleon",
|
||||||
'sphinx.ext.viewcode',
|
"sphinx.ext.viewcode",
|
||||||
'sphinx.ext.autosectionlabel',
|
"sphinx.ext.autosectionlabel",
|
||||||
'myst_parser',
|
"myst_parser",
|
||||||
"sphinx_copybutton",
|
"sphinx_copybutton",
|
||||||
"sphinx_inline_tabs",
|
"sphinx_inline_tabs",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
# Add any paths that contain templates here, relative to this directory.
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
templates_path = ['_templates']
|
templates_path = ["_templates"]
|
||||||
|
|
||||||
# List of patterns, relative to source directory, that match files and
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
# This pattern also affects html_static_path and html_extra_path.
|
# This pattern also affects html_static_path and html_extra_path.
|
||||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'TODO/*']
|
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "TODO/*"]
|
||||||
|
|
||||||
source_suffix = [".rst", ".md"]
|
source_suffix = [".rst", ".md"]
|
||||||
|
|
||||||
myst_enable_extensions = ['linkify',]
|
myst_enable_extensions = [
|
||||||
|
"linkify",
|
||||||
|
]
|
||||||
|
|
||||||
# 'sphinxcontrib.katex',
|
# 'sphinxcontrib.katex',
|
||||||
# 'sphinx.ext.autosectionlabel',
|
# 'sphinx.ext.autosectionlabel',
|
||||||
|
@ -74,17 +76,17 @@ myst_enable_extensions = ['linkify',]
|
||||||
# duplicated section names that are in different documents.
|
# duplicated section names that are in different documents.
|
||||||
autosectionlabel_prefix_document = True
|
autosectionlabel_prefix_document = True
|
||||||
|
|
||||||
language = 'en'
|
language = "en"
|
||||||
|
|
||||||
autodoc_inherit_docstrings = False
|
autodoc_inherit_docstrings = False
|
||||||
|
|
||||||
# Disable displaying type annotations, these can be very verbose
|
# Disable displaying type annotations, these can be very verbose
|
||||||
autodoc_typehints = 'none'
|
autodoc_typehints = "none"
|
||||||
|
|
||||||
# Enable overriding of function signatures in the first line of the docstring.
|
# Enable overriding of function signatures in the first line of the docstring.
|
||||||
autodoc_docstring_signature = True
|
autodoc_docstring_signature = True
|
||||||
|
|
||||||
napoleon_custom_sections = [('Shapes', 'shape')]
|
napoleon_custom_sections = [("Shapes", "shape")]
|
||||||
|
|
||||||
|
|
||||||
# -- Options for HTML output -------------------------------------------------
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
@ -92,7 +94,7 @@ napoleon_custom_sections = [('Shapes', 'shape')]
|
||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
#
|
||||||
html_theme = 'furo'
|
html_theme = "furo"
|
||||||
html_tite = "TTS"
|
html_tite = "TTS"
|
||||||
html_theme_options = {
|
html_theme_options = {
|
||||||
"light_logo": "logo.png",
|
"light_logo": "logo.png",
|
||||||
|
@ -101,18 +103,18 @@ html_theme_options = {
|
||||||
}
|
}
|
||||||
|
|
||||||
html_sidebars = {
|
html_sidebars = {
|
||||||
'**': [
|
"**": [
|
||||||
"sidebar/scroll-start.html",
|
"sidebar/scroll-start.html",
|
||||||
"sidebar/brand.html",
|
"sidebar/brand.html",
|
||||||
"sidebar/search.html",
|
"sidebar/search.html",
|
||||||
"sidebar/navigation.html",
|
"sidebar/navigation.html",
|
||||||
"sidebar/ethical-ads.html",
|
"sidebar/ethical-ads.html",
|
||||||
"sidebar/scroll-end.html",
|
"sidebar/scroll-end.html",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Add any paths that contain custom static files (such as style sheets) here,
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
# relative to this directory. They are copied after the builtin static files,
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
html_static_path = ['_static']
|
html_static_path = ["_static"]
|
||||||
|
|
|
@ -111,4 +111,3 @@ them and fine-tune it for your own dataset. This will help you in two main ways:
|
||||||
--coqpit.run_name "glow-tts-finetune" \
|
--coqpit.run_name "glow-tts-finetune" \
|
||||||
--coqpit.lr 0.00001
|
--coqpit.lr 0.00001
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -61,5 +61,3 @@ Currently we provide the following pre-configured architectures:
|
||||||
.. autoclass:: TTS.tts.configs.fast_speech_config.FastSpeechConfig
|
.. autoclass:: TTS.tts.configs.fast_speech_config.FastSpeechConfig
|
||||||
:members:
|
:members:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,5 +59,3 @@ If you have a limited VRAM, then you can try using the Guided Attention Loss or
|
||||||
.. autoclass:: TTS.tts.configs.tacotron2_config.Tacotron2Config
|
.. autoclass:: TTS.tts.configs.tacotron2_config.Tacotron2Config
|
||||||
:members:
|
:members:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
27
hubconf.py
27
hubconf.py
|
@ -1,15 +1,11 @@
|
||||||
dependencies = [
|
dependencies = ["torch", "gdown", "pysbd", "gruut", "anyascii", "pypinyin", "coqpit", "mecab-python3", "unidic-lite"]
|
||||||
'torch', 'gdown', 'pysbd', 'gruut', 'anyascii', 'pypinyin', 'coqpit', 'mecab-python3', 'unidic-lite'
|
|
||||||
]
|
|
||||||
import torch
|
import torch
|
||||||
|
|
||||||
from TTS.utils.manage import ModelManager
|
from TTS.utils.manage import ModelManager
|
||||||
from TTS.utils.synthesizer import Synthesizer
|
from TTS.utils.synthesizer import Synthesizer
|
||||||
|
|
||||||
|
|
||||||
def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA',
|
def tts(model_name="tts_models/en/ljspeech/tacotron2-DCA", vocoder_name=None, use_cuda=False):
|
||||||
vocoder_name=None,
|
|
||||||
use_cuda=False):
|
|
||||||
"""TTS entry point for PyTorch Hub that provides a Synthesizer object to synthesize speech from a give text.
|
"""TTS entry point for PyTorch Hub that provides a Synthesizer object to synthesize speech from a give text.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -28,19 +24,20 @@ def tts(model_name='tts_models/en/ljspeech/tacotron2-DCA',
|
||||||
manager = ModelManager()
|
manager = ModelManager()
|
||||||
|
|
||||||
model_path, config_path, model_item = manager.download_model(model_name)
|
model_path, config_path, model_item = manager.download_model(model_name)
|
||||||
vocoder_name = model_item[
|
vocoder_name = model_item["default_vocoder"] if vocoder_name is None else vocoder_name
|
||||||
'default_vocoder'] if vocoder_name is None else vocoder_name
|
|
||||||
vocoder_path, vocoder_config_path, _ = manager.download_model(vocoder_name)
|
vocoder_path, vocoder_config_path, _ = manager.download_model(vocoder_name)
|
||||||
|
|
||||||
# create synthesizer
|
# create synthesizer
|
||||||
synt = Synthesizer(tts_checkpoint=model_path,
|
synt = Synthesizer(
|
||||||
tts_config_path=config_path,
|
tts_checkpoint=model_path,
|
||||||
vocoder_checkpoint=vocoder_path,
|
tts_config_path=config_path,
|
||||||
vocoder_config=vocoder_config_path,
|
vocoder_checkpoint=vocoder_path,
|
||||||
use_cuda=use_cuda)
|
vocoder_config=vocoder_config_path,
|
||||||
|
use_cuda=use_cuda,
|
||||||
|
)
|
||||||
return synt
|
return synt
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
synthesizer = torch.hub.load('coqui-ai/TTS:dev', 'tts', source='github')
|
synthesizer = torch.hub.load("coqui-ai/TTS:dev", "tts", source="github")
|
||||||
synthesizer.tts("This is a test!")
|
synthesizer.tts("This is a test!")
|
||||||
|
|
|
@ -4,4 +4,3 @@ BASEDIR=$(dirname "$0")
|
||||||
echo "$BASEDIR"
|
echo "$BASEDIR"
|
||||||
# run training
|
# run training
|
||||||
CUDA_VISIBLE_DEVICES="" python TTS/bin/compute_statistics.py --config_path $BASEDIR/../inputs/test_glow_tts.json --out_path $BASEDIR/../outputs/scale_stats.npy
|
CUDA_VISIBLE_DEVICES="" python TTS/bin/compute_statistics.py --config_path $BASEDIR/../inputs/test_glow_tts.json --out_path $BASEDIR/../outputs/scale_stats.npy
|
||||||
|
|
||||||
|
|
|
@ -98,5 +98,3 @@
|
||||||
"gst_style_tokens": 10
|
"gst_style_tokens": 10
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,4 +21,3 @@
|
||||||
"do_trim_silence": false
|
"do_trim_silence": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,4 +163,3 @@
|
||||||
// PATHS
|
// PATHS
|
||||||
"output_path": "tests/train_outputs/"
|
"output_path": "tests/train_outputs/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,4 +113,3 @@
|
||||||
// PATHS
|
// PATHS
|
||||||
"output_path": "tests/train_outputs/"
|
"output_path": "tests/train_outputs/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,4 +109,3 @@
|
||||||
// PATHS
|
// PATHS
|
||||||
"output_path": "tests/train_outputs/"
|
"output_path": "tests/train_outputs/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue