From 0b3d32337105fe738d9c1887b9968e122505fb44 Mon Sep 17 00:00:00 2001 From: enhuiz Date: Thu, 12 Jan 2023 18:21:51 +0800 Subject: [PATCH] Add setup --- .gitignore | 3 +++ README.md | 14 ++---------- setup.py | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index bbb955e..21a9a49 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ __pycache__ /logs /ckpts /.cache +/config +/*.egg-info +/vall_e/version.py diff --git a/README.md b/README.md index 85857fc..b4e0e6e 100644 --- a/README.md +++ b/README.md @@ -4,22 +4,12 @@ An unofficial (toy) implementation of [VALL-E](https://valle-demo.github.io/), b [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/enhuiz) -## Requirements - -### 1. Clone the project +## Install ``` -git clone --recurse-submodules https://github.com/enhuiz/vall-e.git +pip install git+https://github.com/enhuiz/vall-e ``` -### 2. Install requirements - -``` -pip install -r requirements.txt -``` - -Note: You may need to install additional requirements as you run the script. - ## Data Preparation 1. Put your data into a folder, e.g. `data/your_data`. Audio files should be named with the suffix `.wav` and text files with `.normalized.txt`. diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e8ee11c --- /dev/null +++ b/setup.py @@ -0,0 +1,62 @@ +import subprocess +from pathlib import Path +from datetime import datetime +from setuptools import setup, find_packages + + +def shell(*args): + out = subprocess.check_output(args) + return out.decode("ascii").strip() + + +def write_version(version_core, pre_release=True): + if pre_release: + time = shell("git", "log", "-1", "--format=%cd", "--date=iso") + time = datetime.strptime(time, "%Y-%m-%d %H:%M:%S %z") + time = time.strftime("%Y%m%d%H%M%S") + dirty = shell("git", "status", "--porcelain") + version = f"{version_core}-dev{time}" + if dirty: + version += ".dirty" + else: + version = version_core + + with open(Path("vall_e", "version.py"), "w") as f: + f.write('__version__ = "{}"\n'.format(version)) + + return version + + +with open("README.md", "r") as f: + long_description = f.read() + +setup( + name="vall-e", + python_requires=">=3.9.0", + version=write_version("0.0.1"), + description="An unofficial toy implementation of the audio LM VALL-E", + author="enhuiz", + author_email="niuzhe.nz@outlook.com", + long_description=long_description, + long_description_content_type="text/markdown", + packages=find_packages(), + install_requires=[ + "coloredlogs==15.0.1", + "deepspeed==0.7.7", + "diskcache==5.4.0", + "einops==0.6.0", + "encodec==0.1.1", + "g2p_en==2.1.0", + "humanize==4.4.0", + "matplotlib==3.6.0", + "numpy==1.23.3", + "omegaconf==2.2.3", + "openTSNE==0.6.2", + "pandas==1.5.0", + "soundfile==0.11.0", + "torch==1.13.0+cu116", + "torchaudio==0.13.0+cu116", + "tqdm==4.64.1", + ], + url="https://github.com/enhuiz/VALL_E", +)