{ "cells": [ { "cell_type": "code", "execution_count": 2, "id": "cb5d0890-3f2d-4020-8270-f3a9bb9f63c6", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu116\n", "Requirement already satisfied: torch==1.13.1 in /usr/local/lib/python3.10/dist-packages (1.13.1+cu117)\n", "Requirement already satisfied: torchaudio==0.13.1 in /usr/local/lib/python3.10/dist-packages (0.13.1+cu117)\n", "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch==1.13.1) (4.7.1)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n", "\n", "[notice] A new release of pip is available: 23.1.2 -> 23.2.1\n", "[notice] To update, run: python -m pip install --upgrade pip\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: torchmetrics==0.11.1 in /usr/local/lib/python3.10/dist-packages (0.11.1)\n", "Requirement already satisfied: numpy>=1.17.2 in /usr/local/lib/python3.10/dist-packages (from torchmetrics==0.11.1) (1.24.4)\n", "Requirement already satisfied: torch>=1.8.1 in /usr/local/lib/python3.10/dist-packages (from torchmetrics==0.11.1) (1.13.1+cu117)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from torchmetrics==0.11.1) (23.1)\n", "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch>=1.8.1->torchmetrics==0.11.1) (4.7.1)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n", "\n", "[notice] A new release of pip is available: 23.1.2 -> 23.2.1\n", "[notice] To update, run: python -m pip install --upgrade pip\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: librosa in /usr/local/lib/python3.10/dist-packages (0.10.1)\n", "Requirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (3.8.0)\n", "Requirement already satisfied: audioread>=2.1.9 in /usr/local/lib/python3.10/dist-packages (from librosa) (3.0.0)\n", "Requirement already satisfied: numpy!=1.22.0,!=1.22.1,!=1.22.2,>=1.20.3 in /usr/local/lib/python3.10/dist-packages (from librosa) (1.24.4)\n", "Requirement already satisfied: scipy>=1.2.0 in /usr/local/lib/python3.10/dist-packages (from librosa) (1.11.2)\n", "Requirement already satisfied: scikit-learn>=0.20.0 in /usr/local/lib/python3.10/dist-packages (from librosa) (1.3.0)\n", "Requirement already satisfied: joblib>=0.14 in /usr/local/lib/python3.10/dist-packages (from librosa) (1.3.2)\n", "Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.10/dist-packages (from librosa) (5.1.1)\n", "Requirement already satisfied: numba>=0.51.0 in /usr/local/lib/python3.10/dist-packages (from librosa) (0.57.1)\n", "Requirement already satisfied: soundfile>=0.12.1 in /usr/local/lib/python3.10/dist-packages (from librosa) (0.12.1)\n", "Requirement already satisfied: pooch>=1.0 in /usr/local/lib/python3.10/dist-packages (from librosa) (1.7.0)\n", "Requirement already satisfied: soxr>=0.3.2 in /usr/local/lib/python3.10/dist-packages (from librosa) (0.3.6)\n", "Requirement already satisfied: typing-extensions>=4.1.1 in /usr/local/lib/python3.10/dist-packages (from librosa) (4.7.1)\n", "Requirement already satisfied: lazy-loader>=0.1 in /usr/local/lib/python3.10/dist-packages (from librosa) (0.3)\n", "Requirement already satisfied: msgpack>=1.0 in /usr/local/lib/python3.10/dist-packages (from librosa) (1.0.5)\n", "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (1.1.1)\n", "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (0.11.0)\n", "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (4.42.1)\n", "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (1.4.5)\n", "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (23.1)\n", "Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (10.0.0)\n", "Requirement already satisfied: pyparsing>=2.3.1 in /usr/lib/python3/dist-packages (from matplotlib) (2.4.7)\n", "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib) (2.8.2)\n", "Requirement already satisfied: llvmlite<0.41,>=0.40.0dev0 in /usr/local/lib/python3.10/dist-packages (from numba>=0.51.0->librosa) (0.40.1)\n", "Requirement already satisfied: platformdirs>=2.5.0 in /usr/local/lib/python3.10/dist-packages (from pooch>=1.0->librosa) (3.8.1)\n", "Requirement already satisfied: requests>=2.19.0 in /usr/local/lib/python3.10/dist-packages (from pooch>=1.0->librosa) (2.31.0)\n", "Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib) (1.16.0)\n", "Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.10/dist-packages (from scikit-learn>=0.20.0->librosa) (3.2.0)\n", "Requirement already satisfied: cffi>=1.0 in /usr/local/lib/python3.10/dist-packages (from soundfile>=0.12.1->librosa) (1.15.1)\n", "Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.0->soundfile>=0.12.1->librosa) (2.21)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa) (3.2.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa) (3.4)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa) (1.26.16)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests>=2.19.0->pooch>=1.0->librosa) (2023.5.7)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n", "\n", "[notice] A new release of pip is available: 23.1.2 -> 23.2.1\n", "[notice] To update, run: python -m pip install --upgrade pip\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Reading package lists...\n", "Building dependency tree...\n", "Reading state information...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "E: Unable to locate package espeak-ng\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: phonemizer==3.2.1 in /usr/local/lib/python3.10/dist-packages (3.2.1)\n", "Requirement already satisfied: pypinyin==0.48.0 in /usr/local/lib/python3.10/dist-packages (0.48.0)\n", "Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from phonemizer==3.2.1) (1.3.2)\n", "Requirement already satisfied: segments in /usr/local/lib/python3.10/dist-packages (from phonemizer==3.2.1) (2.2.1)\n", "Requirement already satisfied: attrs>=18.1 in /usr/local/lib/python3.10/dist-packages (from phonemizer==3.2.1) (23.1.0)\n", "Requirement already satisfied: dlinfo in /usr/local/lib/python3.10/dist-packages (from phonemizer==3.2.1) (1.2.1)\n", "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from phonemizer==3.2.1) (4.7.1)\n", "Requirement already satisfied: clldutils>=1.7.3 in /usr/local/lib/python3.10/dist-packages (from segments->phonemizer==3.2.1) (3.20.0)\n", "Requirement already satisfied: csvw>=1.5.6 in /usr/local/lib/python3.10/dist-packages (from segments->phonemizer==3.2.1) (3.1.3)\n", "Requirement already satisfied: regex in /usr/local/lib/python3.10/dist-packages (from segments->phonemizer==3.2.1) (2023.8.8)\n", "Requirement already satisfied: python-dateutil in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (2.8.2)\n", "Requirement already satisfied: tabulate>=0.7.7 in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (0.9.0)\n", "Requirement already satisfied: colorlog in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (6.7.0)\n", "Requirement already satisfied: pylatexenc in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (2.10)\n", "Requirement already satisfied: markdown in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (3.4.4)\n", "Requirement already satisfied: lxml in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (4.9.3)\n", "Requirement already satisfied: markupsafe in /usr/local/lib/python3.10/dist-packages (from clldutils>=1.7.3->segments->phonemizer==3.2.1) (2.1.3)\n", "Requirement already satisfied: babel in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (2.12.1)\n", "Requirement already satisfied: colorama in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (0.4.6)\n", "Requirement already satisfied: isodate in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (0.6.1)\n", "Requirement already satisfied: jsonschema in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (4.18.0)\n", "Requirement already satisfied: language-tags in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (1.2.0)\n", "Requirement already satisfied: rdflib in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (7.0.0)\n", "Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (2.31.0)\n", "Requirement already satisfied: rfc3986<2 in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (1.5.0)\n", "Requirement already satisfied: uritemplate>=3.0.0 in /usr/local/lib/python3.10/dist-packages (from csvw>=1.5.6->segments->phonemizer==3.2.1) (4.1.1)\n", "Requirement already satisfied: six in /usr/lib/python3/dist-packages (from isodate->csvw>=1.5.6->segments->phonemizer==3.2.1) (1.16.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer==3.2.1) (2023.6.1)\n", "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer==3.2.1) (0.29.1)\n", "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer==3.2.1) (0.8.10)\n", "Requirement already satisfied: pyparsing<4,>=2.1.0 in /usr/lib/python3/dist-packages (from rdflib->csvw>=1.5.6->segments->phonemizer==3.2.1) (2.4.7)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer==3.2.1) (3.2.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer==3.2.1) (3.4)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer==3.2.1) (1.26.16)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer==3.2.1) (2023.5.7)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n", "\n", "[notice] A new release of pip is available: 23.1.2 -> 23.2.1\n", "[notice] To update, run: python -m pip install --upgrade pip\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: lhotse in /usr/local/lib/python3.10/dist-packages (1.16.0)\n", "Requirement already satisfied: audioread>=2.1.9 in /usr/local/lib/python3.10/dist-packages (from lhotse) (3.0.0)\n", "Requirement already satisfied: SoundFile>=0.10 in /usr/local/lib/python3.10/dist-packages (from lhotse) (0.12.1)\n", "Requirement already satisfied: click>=7.1.1 in /usr/local/lib/python3.10/dist-packages (from lhotse) (8.1.7)\n", "Requirement already satisfied: cytoolz>=0.10.1 in /usr/local/lib/python3.10/dist-packages (from lhotse) (0.12.2)\n", "Requirement already satisfied: dataclasses in /usr/local/lib/python3.10/dist-packages (from lhotse) (0.6)\n", "Requirement already satisfied: intervaltree>=3.1.0 in /usr/local/lib/python3.10/dist-packages (from lhotse) (3.1.0)\n", "Requirement already satisfied: numpy>=1.18.1 in /usr/local/lib/python3.10/dist-packages (from lhotse) (1.24.4)\n", "Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from lhotse) (23.1)\n", "Requirement already satisfied: pyyaml>=5.3.1 in /usr/local/lib/python3.10/dist-packages (from lhotse) (6.0)\n", "Requirement already satisfied: tabulate>=0.8.1 in /usr/local/lib/python3.10/dist-packages (from lhotse) (0.9.0)\n", "Requirement already satisfied: tqdm in /usr/local/lib/python3.10/dist-packages (from lhotse) (4.66.1)\n", "Requirement already satisfied: lilcom>=1.1.0 in /usr/local/lib/python3.10/dist-packages (from lhotse) (1.7)\n", "Requirement already satisfied: toolz>=0.8.0 in /usr/local/lib/python3.10/dist-packages (from cytoolz>=0.10.1->lhotse) (0.12.0)\n", "Requirement already satisfied: sortedcontainers<3.0,>=2.0 in /usr/local/lib/python3.10/dist-packages (from intervaltree>=3.1.0->lhotse) (2.4.0)\n", "Requirement already satisfied: cffi>=1.0 in /usr/local/lib/python3.10/dist-packages (from SoundFile>=0.10->lhotse) (1.15.1)\n", "Requirement already satisfied: pycparser in /usr/local/lib/python3.10/dist-packages (from cffi>=1.0->SoundFile>=0.10->lhotse) (2.21)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n", "\n", "[notice] A new release of pip is available: 23.1.2 -> 23.2.1\n", "[notice] To update, run: python -m pip install --upgrade pip\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Collecting k2==1.23.4.dev20230224+cuda11.7.torch1.13.1\n", " Downloading https://huggingface.co/csukuangfj/k2/resolve/main/cuda/k2-1.23.4.dev20230224+cuda11.7.torch1.13.1-cp310-cp310-linux_x86_64.whl (103.1 MB)\n", "\u001b[2K ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.1/103.1 MB 29.2 MB/s eta 0:00:00\n", "\u001b[?25hRequirement already satisfied: torch==1.13.1 in /usr/local/lib/python3.10/dist-packages (from k2==1.23.4.dev20230224+cuda11.7.torch1.13.1) (1.13.1+cu117)\n", "Requirement already satisfied: graphviz in /usr/local/lib/python3.10/dist-packages (from k2==1.23.4.dev20230224+cuda11.7.torch1.13.1) (0.20.1)\n", "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.10/dist-packages (from torch==1.13.1->k2==1.23.4.dev20230224+cuda11.7.torch1.13.1) (4.7.1)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n", "\n", "[notice] A new release of pip is available: 23.1.2 -> 23.2.1\n", "[notice] To update, run: python -m pip install --upgrade pip\n", "mkdir: cannot create directory ‘tmp’: File exists\n", "Cloning into 'icefall'...\n", "fetch-pack: unexpected disconnect while reading sideband packet\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Process is interrupted.\n" ] } ], "source": [ "%%bash\n", "# install the vall-e and required libraries\n", "# PyTorch\n", "pip install torch==1.13.1 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116\n", "pip install torchmetrics==0.11.1\n", "# fbank\n", "pip install librosa matplotlib\n", "\n", "# phonemizer pypinyin\n", "apt-get install espeak-ng -y\n", "## OSX: brew install espeak\n", "pip install phonemizer==3.2.1 pypinyin==0.48.0\n", "\n", "pip install lhotse\n", "\n", "# k2\n", "# find the right version in https://huggingface.co/csukuangfj/k2\n", "pip install https://huggingface.co/csukuangfj/k2/resolve/main/cuda/k2-1.23.4.dev20230224+cuda11.7.torch1.13.1-cp310-cp310-linux_x86_64.whl\n", "mkdir tmp\n", "\n", "git clone https://github.com/k2-fsa/icefall\n", "mv icefall tmp\n", "cd tmp/icefall\n", "pip install -r requirements.txt\n", "pip install -e .\n", "export PYTHONPATH=`pwd`/../icefall:$PYTHONPATH\n", "echo \"export PYTHONPATH=`pwd`/../icefall:\\$PYTHONPATH\" >> ~/.zshrc\n", "echo \"export PYTHONPATH=`pwd`/../icefall:\\$PYTHONPATH\" >> ~/.bashrc\n", "cd ../..\n", "source ~/.zshrc\n", "source ~/.bashrc\n", "\n", "\n", "git clone https://github.com/lifeiteng/vall-e\n", "mv vall-e tmp\n", "cd tmp/vall-e\n", "pip install -e .\n", "\n", "pip install vocos" ] }, { "cell_type": "code", "execution_count": 2, "id": "fc4f7f9d-235b-4dd5-9384-42c3f6c65428", "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--2023-09-21 06:28:48-- https://huggingface.co/LearnItAnyway/vall-e_korean/resolve/main/vall-e_ko_v0.pt\n", "Resolving huggingface.co (huggingface.co)... 13.32.110.77, 13.32.110.109, 13.32.110.28, ...\n", "Connecting to huggingface.co (huggingface.co)|13.32.110.77|:443... connected.\n", "HTTP request sent, awaiting response... 302 Found\n", "Location: https://cdn-lfs.huggingface.co/repos/f8/b9/f8b90061950052a23944dd83f71a6f031a5d39c73dbb799693620ca8a4186a97/e2894775b160c24132f8f6d6d7df6cc8bf59a9b465778d08989e200859610560?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27vall-e_ko_v0.pt%3B+filename%3D%22vall-e_ko_v0.pt%22%3B&Expires=1695536928&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5NTUzNjkyOH19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy9mOC9iOS9mOGI5MDA2MTk1MDA1MmEyMzk0NGRkODNmNzFhNmYwMzFhNWQzOWM3M2RiYjc5OTY5MzYyMGNhOGE0MTg2YTk3L2UyODk0Nzc1YjE2MGMyNDEzMmY4ZjZkNmQ3ZGY2Y2M4YmY1OWE5YjQ2NTc3OGQwODk4OWUyMDA4NTk2MTA1NjA%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qIn1dfQ__&Signature=EjVtvNUk%7E2tZyrflILNnAD6w-KTF1ymHSkMz%7EicG8YD05s8KvFGPJfmidMFLduH2RIPlzyucFCL7Nu3ncreEiQcyPaIcVVLW7dCzOktXKevQ9dRTeSTSOtyWe17lHT0SwQ8JTYH2DNydvYQXtf%7E6iaInP%7EINwzdlmYkxBW6pgKycakZliLgw0UmyfOY2IX424uNozaqKWhCfAB7EqBLsmfxXnRZtGrtrch78YK3FkowE5iQj0Gt87AwAEg30aOrSqLv7wmplMBiu8GegaUa40wWqH9AjuB1eeYvdkoMtt3eBEmzYXXMkd3xtY5E6aRGgwQepf4%7EeEsxuyNHvA%7EZpTA__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n", "--2023-09-21 06:28:48-- https://cdn-lfs.huggingface.co/repos/f8/b9/f8b90061950052a23944dd83f71a6f031a5d39c73dbb799693620ca8a4186a97/e2894775b160c24132f8f6d6d7df6cc8bf59a9b465778d08989e200859610560?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27vall-e_ko_v0.pt%3B+filename%3D%22vall-e_ko_v0.pt%22%3B&Expires=1695536928&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTY5NTUzNjkyOH19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy9mOC9iOS9mOGI5MDA2MTk1MDA1MmEyMzk0NGRkODNmNzFhNmYwMzFhNWQzOWM3M2RiYjc5OTY5MzYyMGNhOGE0MTg2YTk3L2UyODk0Nzc1YjE2MGMyNDEzMmY4ZjZkNmQ3ZGY2Y2M4YmY1OWE5YjQ2NTc3OGQwODk4OWUyMDA4NTk2MTA1NjA%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qIn1dfQ__&Signature=EjVtvNUk%7E2tZyrflILNnAD6w-KTF1ymHSkMz%7EicG8YD05s8KvFGPJfmidMFLduH2RIPlzyucFCL7Nu3ncreEiQcyPaIcVVLW7dCzOktXKevQ9dRTeSTSOtyWe17lHT0SwQ8JTYH2DNydvYQXtf%7E6iaInP%7EINwzdlmYkxBW6pgKycakZliLgw0UmyfOY2IX424uNozaqKWhCfAB7EqBLsmfxXnRZtGrtrch78YK3FkowE5iQj0Gt87AwAEg30aOrSqLv7wmplMBiu8GegaUa40wWqH9AjuB1eeYvdkoMtt3eBEmzYXXMkd3xtY5E6aRGgwQepf4%7EeEsxuyNHvA%7EZpTA__&Key-Pair-Id=KVTP0A1DKRTAX\n", "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 18.66.122.69, 18.66.122.21, 18.66.122.62, ...\n", "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|18.66.122.69|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 2699959616 (2.5G) [binary/octet-stream]\n", "Saving to: ‘vall-e_ko_v0.pt’\n", "\n", "vall-e_ko_v0.pt 100%[===================>] 2.51G 55.9MB/s in 48s \n", "\n", "2023-09-21 06:29:36 (53.4 MB/s) - ‘vall-e_ko_v0.pt’ saved [2699959616/2699959616]\n", "\n", "--2023-09-21 06:29:36-- https://huggingface.co/LearnItAnyway/vall-e_korean/resolve/main/unique_text_tokens.k2symbols\n", "Resolving huggingface.co (huggingface.co)... 13.32.110.77, 13.32.110.109, 13.32.110.28, ...\n", "Connecting to huggingface.co (huggingface.co)|13.32.110.77|:443... connected.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: 3238 (3.2K) [text/plain]\n", "Saving to: ‘unique_text_tokens.k2symbols’\n", "\n", "unique_text_tokens. 100%[===================>] 3.16K --.-KB/s in 0s \n", "\n", "2023-09-21 06:29:37 (2.02 GB/s) - ‘unique_text_tokens.k2symbols’ saved [3238/3238]\n", "\n" ] } ], "source": [ "!wget https://huggingface.co/LearnItAnyway/vall-e_korean/resolve/main/vall-e_ko_v0.pt\n", "!wget https://huggingface.co/LearnItAnyway/vall-e_korean/resolve/main/unique_text_tokens.k2symbols" ] }, { "cell_type": "code", "execution_count": 1, "id": "1b8a4af2-5851-4c41-96bb-bda4b259f857", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Use 32 cpu cores for computing\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Downloading: \"https://dl.fbaipublicfiles.com/encodec/v0/encodec_24khz-d7cc33bc.th\" to /root/.cache/torch/hub/checkpoints/encodec_24khz-d7cc33bc.th\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "57d28016d2664410925e41c812bddbca", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0.00/88.9M [00:00=22.0 (from gradio)\n", " Downloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\n", "Collecting altair<6.0,>=4.2.0 (from gradio)\n", " Downloading altair-5.1.1-py3-none-any.whl (520 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m520.6/520.6 kB\u001b[0m \u001b[31m16.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting fastapi (from gradio)\n", " Downloading fastapi-0.103.1-py3-none-any.whl (66 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m66.2/66.2 kB\u001b[0m \u001b[31m19.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting ffmpy (from gradio)\n", " Downloading ffmpy-0.3.1.tar.gz (5.5 kB)\n", " Preparing metadata (setup.py) ... \u001b[?25ldone\n", "\u001b[?25hCollecting gradio-client==0.5.1 (from gradio)\n", " Downloading gradio_client-0.5.1-py3-none-any.whl (298 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m298.2/298.2 kB\u001b[0m \u001b[31m22.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting httpx (from gradio)\n", " Downloading httpx-0.25.0-py3-none-any.whl (75 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m75.7/75.7 kB\u001b[0m \u001b[31m23.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: huggingface-hub>=0.14.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (0.17.2)\n", "Collecting importlib-resources<7.0,>=1.3 (from gradio)\n", " Downloading importlib_resources-6.1.0-py3-none-any.whl (33 kB)\n", "Requirement already satisfied: jinja2<4.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (3.1.2)\n", "Requirement already satisfied: markupsafe~=2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (2.1.3)\n", "Requirement already satisfied: matplotlib~=3.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (3.8.0)\n", "Requirement already satisfied: numpy~=1.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (1.24.4)\n", "Collecting orjson~=3.0 (from gradio)\n", " Downloading orjson-3.9.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (138 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m138.7/138.7 kB\u001b[0m \u001b[31m35.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from gradio) (23.1)\n", "Collecting pandas<3.0,>=1.0 (from gradio)\n", " Downloading pandas-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.3 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.3/12.3 MB\u001b[0m \u001b[31m16.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hRequirement already satisfied: pillow<11.0,>=8.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (10.0.0)\n", "Collecting pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 (from gradio)\n", " Downloading pydantic-2.3.0-py3-none-any.whl (374 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m374.5/374.5 kB\u001b[0m \u001b[31m26.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting pydub (from gradio)\n", " Downloading pydub-0.25.1-py2.py3-none-any.whl (32 kB)\n", "Collecting python-multipart (from gradio)\n", " Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m17.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (6.0)\n", "Requirement already satisfied: requests~=2.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (2.31.0)\n", "Collecting semantic-version~=2.0 (from gradio)\n", " Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\n", "Requirement already satisfied: typing-extensions~=4.0 in /usr/local/lib/python3.10/dist-packages (from gradio) (4.7.1)\n", "Collecting uvicorn>=0.14.0 (from gradio)\n", " Downloading uvicorn-0.23.2-py3-none-any.whl (59 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.5/59.5 kB\u001b[0m \u001b[31m22.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting websockets<12.0,>=10.0 (from gradio)\n", " Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m45.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from gradio-client==0.5.1->gradio) (2023.9.1)\n", "Requirement already satisfied: jsonschema>=3.0 in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (4.18.0)\n", "Requirement already satisfied: toolz in /usr/local/lib/python3.10/dist-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.14.0->gradio) (3.12.4)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub>=0.14.0->gradio) (4.66.1)\n", "Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (1.1.1)\n", "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (0.11.0)\n", "Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (4.42.1)\n", "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (1.4.5)\n", "Requirement already satisfied: pyparsing>=2.3.1 in /usr/lib/python3/dist-packages (from matplotlib~=3.0->gradio) (2.4.7)\n", "Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib~=3.0->gradio) (2.8.2)\n", "Collecting pytz>=2020.1 (from pandas<3.0,>=1.0->gradio)\n", " Downloading pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m502.5/502.5 kB\u001b[0m \u001b[31m23.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting tzdata>=2022.1 (from pandas<3.0,>=1.0->gradio)\n", " Downloading tzdata-2023.3-py2.py3-none-any.whl (341 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m341.8/341.8 kB\u001b[0m \u001b[31m20.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting annotated-types>=0.4.0 (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio)\n", " Downloading annotated_types-0.5.0-py3-none-any.whl (11 kB)\n", "Collecting pydantic-core==2.6.3 (from pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4->gradio)\n", " Downloading pydantic_core-2.6.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.9/1.9 MB\u001b[0m \u001b[31m10.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n", "\u001b[?25hRequirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (3.2.0)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (3.4)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (1.26.16)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests~=2.0->gradio) (2023.5.7)\n", "Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.10/dist-packages (from uvicorn>=0.14.0->gradio) (8.1.7)\n", "Collecting h11>=0.8 (from uvicorn>=0.14.0->gradio)\n", " Downloading h11-0.14.0-py3-none-any.whl (58 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m18.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: anyio<4.0.0,>=3.7.1 in /usr/local/lib/python3.10/dist-packages (from fastapi->gradio) (3.7.1)\n", "Collecting starlette<0.28.0,>=0.27.0 (from fastapi->gradio)\n", " Downloading starlette-0.27.0-py3-none-any.whl (66 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m24.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hCollecting httpcore<0.19.0,>=0.18.0 (from httpx->gradio)\n", " Downloading httpcore-0.18.0-py3-none-any.whl (76 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.0/76.0 kB\u001b[0m \u001b[31m23.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hRequirement already satisfied: sniffio in /usr/local/lib/python3.10/dist-packages (from httpx->gradio) (1.3.0)\n", "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<4.0.0,>=3.7.1->fastapi->gradio) (1.1.2)\n", "Requirement already satisfied: attrs>=22.2.0 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (23.1.0)\n", "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.6.1)\n", "Requirement already satisfied: referencing>=0.28.4 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.29.1)\n", "Requirement already satisfied: rpds-py>=0.7.1 in /usr/local/lib/python3.10/dist-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.8.10)\n", "Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\n", "Building wheels for collected packages: ffmpy\n", " Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n", "\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=97b9a5fbfa40c640a1a096fb921cf42f65fb02d09b80a4e8195a50d27270698e\n", " Stored in directory: /root/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n", "Successfully built ffmpy\n", "Installing collected packages: pytz, pydub, ffmpy, websockets, tzdata, semantic-version, python-multipart, pydantic-core, orjson, importlib-resources, h11, annotated-types, aiofiles, uvicorn, starlette, pydantic, pandas, httpcore, httpx, fastapi, gradio-client, altair, gradio\n", "Successfully installed aiofiles-23.2.1 altair-5.1.1 annotated-types-0.5.0 fastapi-0.103.1 ffmpy-0.3.1 gradio-3.44.4 gradio-client-0.5.1 h11-0.14.0 httpcore-0.18.0 httpx-0.25.0 importlib-resources-6.1.0 orjson-3.9.7 pandas-2.1.1 pydantic-2.3.0 pydantic-core-2.6.3 pydub-0.25.1 python-multipart-0.0.6 pytz-2023.3.post1 semantic-version-2.10.0 starlette-0.27.0 tzdata-2023.3 uvicorn-0.23.2 websockets-11.0.3\n", "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n", "\u001b[0m\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.1.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.2.1\u001b[0m\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython -m pip install --upgrade pip\u001b[0m\n" ] } ], "source": [ "!pip install gradio" ] }, { "cell_type": "code", "execution_count": 4, "id": "6b59cf2b-2826-40be-a27f-e6dbfe0cc1c0", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Running on local URL: http://127.0.0.1:7860\n", "Running on public URL: https://e3c6ff480c5537ff44.gradio.live\n", "\n", "This share link expires in 72 hours. For free permanent hosting and GPU upgrades, run `gradio deploy` from Terminal to deploy to Spaces (https://huggingface.co/spaces)\n" ] }, { "data": { "text/html": [ "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import gradio as gr\n", "app = gr.Blocks(title=\"VALL-E Korean\")\n", "with app:\n", " #gr.Markdown(top_md)\n", " with gr.Tab(\"VALL-E Korean Demo\"):\n", " #gr.Markdown(infer_from_prompt_md)\n", " with gr.Row():\n", " with gr.Column():\n", " text_prompt = gr.TextArea(label=\"Input Text\",\n", " placeholder=\"Type text in the audio file (Korean)\",)\n", " audio_prompt= gr.Audio(label=\"Input Audio\", source='upload', interactive=True, type=\"filepath\")\n", " text_input = gr.TextArea(label=\"Output Text\",\n", " placeholder=\"Type text you want to generate (Korean)\",)\n", " with gr.Column():\n", " text_output = gr.Textbox(label=\"Message\")\n", " audio_output= gr.Audio(label=\"Output Audio\")\n", " btn = gr.Button(\"Generate!\")\n", " btn.click(infer_from_prompt,\n", " inputs=[text_prompt, audio_prompt, text_input],\n", " outputs=[text_output, audio_output])\n", "webbrowser.open(\"http://127.0.0.1:7860\")\n", "app.launch(share=True)" ] }, { "cell_type": "code", "execution_count": null, "id": "fafc648b-2165-45a1-b422-38ced5f4d8fa", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.6" } }, "nbformat": 4, "nbformat_minor": 5 }