diff --git a/TTS/tts/layers/glow_tts/monotonic_align/setup.py b/TTS/tts/layers/glow_tts/monotonic_align/setup.py index 1d669ea0..f22bc6a3 100644 --- a/TTS/tts/layers/glow_tts/monotonic_align/setup.py +++ b/TTS/tts/layers/glow_tts/monotonic_align/setup.py @@ -1,7 +1,7 @@ -from distutils.core import setup -from Cython.Build import cythonize -import numpy +# from distutils.core import setup +# from Cython.Build import cythonize +# import numpy -setup(name='monotonic_align', - ext_modules=cythonize("core.pyx"), - include_dirs=[numpy.get_include()]) +# setup(name='monotonic_align', +# ext_modules=cythonize("core.pyx"), +# include_dirs=[numpy.get_include()]) diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 68bc92d2..c90d3931 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -51,7 +51,7 @@ class ModelManager(object): for model_type in self.models_dict: for lang in self.models_dict[model_type]: 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} ") def download_model(self, model_name): @@ -66,9 +66,9 @@ class ModelManager(object): TODO: support multi-speaker models """ # fetch model info from the dict - type, lang, dataset, model = model_name.split("/") - model_full_name = f"{type}--{lang}--{dataset}--{model}" - model_item = self.models_dict[type][lang][dataset][model] + model_type, lang, dataset, model = model_name.split("/") + model_full_name = f"{model_type}--{lang}--{dataset}--{model}" + model_item = self.models_dict[model_type][lang][dataset][model] # set the model specific output path output_path = os.path.join(self.output_prefix, model_full_name) output_model_path = os.path.join(output_path, "model_file.pth.tar") @@ -93,8 +93,8 @@ class ModelManager(object): json.dump(config, jf) return output_model_path, output_config_path - def _download_file(self, id, output): - gdown.download(f"{self.url_prefix}{id}", output=output) + def _download_file(self, idx, output): + gdown.download(f"{self.url_prefix}{idx}", output=output) diff --git a/setup.py b/setup.py index 5504007c..7e070b6c 100644 --- a/setup.py +++ b/setup.py @@ -5,22 +5,16 @@ import os import shutil import subprocess import sys + import numpy - -from setuptools import setup, find_packages -import setuptools.command.develop import setuptools.command.build_py +import setuptools.command.develop -# handle import if cython is not already installed. -try: - 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) - +from setuptools import find_packages, setup +from distutils.extension import Extension +from Cython.Build import cythonize +# parameters for wheeling server. parser = argparse.ArgumentParser(add_help=False, allow_abbrev=False) parser.add_argument('--checkpoint', 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 sys.argv = [sys.argv[0]] + unknown_args -version = '0.0.9a9' +version = '0.0.9a10' cwd = os.path.dirname(os.path.abspath(__file__)) # Handle Cython code -def find_pyx(path='.'): - pyx_files = [] - for root, _, filenames in os.walk(path): - for fname in filenames: - if fname.endswith('.pyx'): - pyx_files.append(os.path.join(root, fname)) - return pyx_files +# def find_pyx(path='.'): +# pyx_files = [] +# for root, _, filenames in os.walk(path): +# for fname in filenames: +# if fname.endswith('.pyx'): +# pyx_files.append(os.path.join(root, fname)) +# return pyx_files -def find_cython_extensions(path="."): - exts = cythonize(find_pyx(path), language_level=3) - for ext in exts: - ext.include_dirs = [numpy.get_include()] - return exts +# def find_cython_extensions(path="."): +# exts = cythonize(find_pyx(path), language_level=3) +# for ext in exts: +# ext.include_dirs = [numpy.get_include()] +# return exts 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: 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( name='TTS', version=version, @@ -105,8 +101,12 @@ setup( long_description=README, long_description_content_type="text/markdown", license='MPL-2.0', - include_package_data = True, - ext_modules=find_cython_extensions(), + # cython + 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*']), project_urls={ 'Documentation': 'https://github.com/mozilla/TTS/wiki', @@ -117,6 +117,7 @@ setup( cmdclass={ 'build_py': build_py, 'develop': develop, + # 'build_ext': build_ext }, install_requires=requirements, python_requires='>=3.6.0, <3.9', @@ -144,4 +145,6 @@ setup( "Topic :: Multimedia :: Sound/Audio", "Topic :: Multimedia", "Topic :: Scientific/Engineering :: Artificial Intelligence" - ]) + ], + zip_safe=False +)