mirror of https://github.com/coqui-ai/TTS.git
setup.py update and pylint fixes
This commit is contained in:
parent
660d61aeeb
commit
b464cab9b8
|
@ -1,7 +1,7 @@
|
||||||
from distutils.core import setup
|
# from distutils.core import setup
|
||||||
from Cython.Build import cythonize
|
# from Cython.Build import cythonize
|
||||||
import numpy
|
# import numpy
|
||||||
|
|
||||||
setup(name='monotonic_align',
|
# setup(name='monotonic_align',
|
||||||
ext_modules=cythonize("core.pyx"),
|
# ext_modules=cythonize("core.pyx"),
|
||||||
include_dirs=[numpy.get_include()])
|
# include_dirs=[numpy.get_include()])
|
||||||
|
|
|
@ -51,7 +51,7 @@ class ModelManager(object):
|
||||||
for model_type in self.models_dict:
|
for model_type in self.models_dict:
|
||||||
for lang in self.models_dict[model_type]:
|
for lang in self.models_dict[model_type]:
|
||||||
for dataset in self.models_dict[model_type][lang]:
|
for dataset in self.models_dict[model_type][lang]:
|
||||||
for model in self.models_dict[model_type][lang][dataset]:
|
for model in self.models_dict[model_type][lang][dataset]:
|
||||||
print(f" >: {model_type}/{lang}/{dataset}/{model} ")
|
print(f" >: {model_type}/{lang}/{dataset}/{model} ")
|
||||||
|
|
||||||
def download_model(self, model_name):
|
def download_model(self, model_name):
|
||||||
|
@ -66,9 +66,9 @@ class ModelManager(object):
|
||||||
TODO: support multi-speaker models
|
TODO: support multi-speaker models
|
||||||
"""
|
"""
|
||||||
# fetch model info from the dict
|
# fetch model info from the dict
|
||||||
type, lang, dataset, model = model_name.split("/")
|
model_type, lang, dataset, model = model_name.split("/")
|
||||||
model_full_name = f"{type}--{lang}--{dataset}--{model}"
|
model_full_name = f"{model_type}--{lang}--{dataset}--{model}"
|
||||||
model_item = self.models_dict[type][lang][dataset][model]
|
model_item = self.models_dict[model_type][lang][dataset][model]
|
||||||
# set the model specific output path
|
# set the model specific output path
|
||||||
output_path = os.path.join(self.output_prefix, model_full_name)
|
output_path = os.path.join(self.output_prefix, model_full_name)
|
||||||
output_model_path = os.path.join(output_path, "model_file.pth.tar")
|
output_model_path = os.path.join(output_path, "model_file.pth.tar")
|
||||||
|
@ -93,8 +93,8 @@ class ModelManager(object):
|
||||||
json.dump(config, jf)
|
json.dump(config, jf)
|
||||||
return output_model_path, output_config_path
|
return output_model_path, output_config_path
|
||||||
|
|
||||||
def _download_file(self, id, output):
|
def _download_file(self, idx, output):
|
||||||
gdown.download(f"{self.url_prefix}{id}", output=output)
|
gdown.download(f"{self.url_prefix}{idx}", output=output)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
59
setup.py
59
setup.py
|
@ -5,22 +5,16 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
from setuptools import setup, find_packages
|
|
||||||
import setuptools.command.develop
|
|
||||||
import setuptools.command.build_py
|
import setuptools.command.build_py
|
||||||
|
import setuptools.command.develop
|
||||||
|
|
||||||
# handle import if cython is not already installed.
|
from setuptools import find_packages, setup
|
||||||
try:
|
from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
except ImportError:
|
|
||||||
# create closure for deferred import
|
|
||||||
def cythonize(*args, **kwargs): #pylint: disable=redefined-outer-name
|
|
||||||
from Cython.Build import cythonize #pylint: disable=redefined-outer-name, import-outside-toplevel
|
|
||||||
return cythonize(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
|
# parameters for wheeling server.
|
||||||
parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
|
parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False)
|
||||||
parser.add_argument('--checkpoint',
|
parser.add_argument('--checkpoint',
|
||||||
type=str,
|
type=str,
|
||||||
|
@ -33,24 +27,24 @@ args, unknown_args = parser.parse_known_args()
|
||||||
# Remove our arguments from argv so that setuptools doesn't see them
|
# Remove our arguments from argv so that setuptools doesn't see them
|
||||||
sys.argv = [sys.argv[0]] + unknown_args
|
sys.argv = [sys.argv[0]] + unknown_args
|
||||||
|
|
||||||
version = '0.0.9a9'
|
version = '0.0.9a10'
|
||||||
cwd = os.path.dirname(os.path.abspath(__file__))
|
cwd = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
# Handle Cython code
|
# Handle Cython code
|
||||||
def find_pyx(path='.'):
|
# def find_pyx(path='.'):
|
||||||
pyx_files = []
|
# pyx_files = []
|
||||||
for root, _, filenames in os.walk(path):
|
# for root, _, filenames in os.walk(path):
|
||||||
for fname in filenames:
|
# for fname in filenames:
|
||||||
if fname.endswith('.pyx'):
|
# if fname.endswith('.pyx'):
|
||||||
pyx_files.append(os.path.join(root, fname))
|
# pyx_files.append(os.path.join(root, fname))
|
||||||
return pyx_files
|
# return pyx_files
|
||||||
|
|
||||||
|
|
||||||
def find_cython_extensions(path="."):
|
# def find_cython_extensions(path="."):
|
||||||
exts = cythonize(find_pyx(path), language_level=3)
|
# exts = cythonize(find_pyx(path), language_level=3)
|
||||||
for ext in exts:
|
# for ext in exts:
|
||||||
ext.include_dirs = [numpy.get_include()]
|
# ext.include_dirs = [numpy.get_include()]
|
||||||
return exts
|
# return exts
|
||||||
|
|
||||||
|
|
||||||
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
|
class build_py(setuptools.command.build_py.build_py): # pylint: disable=too-many-ancestors
|
||||||
|
@ -95,6 +89,8 @@ requirements = open(os.path.join(cwd, 'requirements.txt'), 'r').readlines()
|
||||||
with open('README.md', "r", encoding="utf-8") as readme_file:
|
with open('README.md', "r", encoding="utf-8") as readme_file:
|
||||||
README = readme_file.read()
|
README = readme_file.read()
|
||||||
|
|
||||||
|
exts = [Extension(name='TTS.tts.layers.glow_tts.monotonic_align.core',
|
||||||
|
sources=["TTS/tts/layers/glow_tts/monotonic_align/core.pyx"])]
|
||||||
setup(
|
setup(
|
||||||
name='TTS',
|
name='TTS',
|
||||||
version=version,
|
version=version,
|
||||||
|
@ -105,8 +101,12 @@ setup(
|
||||||
long_description=README,
|
long_description=README,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
license='MPL-2.0',
|
license='MPL-2.0',
|
||||||
include_package_data = True,
|
# cython
|
||||||
ext_modules=find_cython_extensions(),
|
include_dirs=numpy.get_include(),
|
||||||
|
ext_modules=cythonize(exts, language_level=3),
|
||||||
|
# ext_modules=find_cython_extensions(),
|
||||||
|
# package
|
||||||
|
include_package_data=True,
|
||||||
packages=find_packages(include=['TTS*']),
|
packages=find_packages(include=['TTS*']),
|
||||||
project_urls={
|
project_urls={
|
||||||
'Documentation': 'https://github.com/mozilla/TTS/wiki',
|
'Documentation': 'https://github.com/mozilla/TTS/wiki',
|
||||||
|
@ -117,6 +117,7 @@ setup(
|
||||||
cmdclass={
|
cmdclass={
|
||||||
'build_py': build_py,
|
'build_py': build_py,
|
||||||
'develop': develop,
|
'develop': develop,
|
||||||
|
# 'build_ext': build_ext
|
||||||
},
|
},
|
||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
python_requires='>=3.6.0, <3.9',
|
python_requires='>=3.6.0, <3.9',
|
||||||
|
@ -144,4 +145,6 @@ setup(
|
||||||
"Topic :: Multimedia :: Sound/Audio",
|
"Topic :: Multimedia :: Sound/Audio",
|
||||||
"Topic :: Multimedia",
|
"Topic :: Multimedia",
|
||||||
"Topic :: Scientific/Engineering :: Artificial Intelligence"
|
"Topic :: Scientific/Engineering :: Artificial Intelligence"
|
||||||
])
|
],
|
||||||
|
zip_safe=False
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in New Issue