Colaboratory を使用して作成しました

This commit is contained in:
w-okada 2023-01-11 18:06:24 +09:00
parent f761034ae9
commit dc7bde5e45

View File

@ -4,7 +4,7 @@
"metadata": { "metadata": {
"colab": { "colab": {
"provenance": [], "provenance": [],
"authorship_tag": "ABX9TyOOGTmM3OfSQrjI1rtDD0EX", "authorship_tag": "ABX9TyNSRTUjuUmmq9gIRJWCoVVn",
"include_colab_link": true "include_colab_link": true
}, },
"kernelspec": { "kernelspec": {
@ -73,7 +73,7 @@
"base_uri": "https://localhost:8080/" "base_uri": "https://localhost:8080/"
}, },
"id": "vV1t7PBRm-o6", "id": "vV1t7PBRm-o6",
"outputId": "3eb56aa6-6f07-48b6-d8d9-7941497ee1fd" "outputId": "aa02d901-b65d-40bf-ff88-c06b88155031"
}, },
"execution_count": 1, "execution_count": 1,
"outputs": [ "outputs": [
@ -81,7 +81,7 @@
"output_type": "stream", "output_type": "stream",
"name": "stdout", "name": "stdout",
"text": [ "text": [
"Sat Dec 10 05:50:35 2022 \n", "Wed Jan 11 08:52:42 2023 \n",
"+-----------------------------------------------------------------------------+\n", "+-----------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n", "| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n",
"|-------------------------------+----------------------+----------------------+\n", "|-------------------------------+----------------------+----------------------+\n",
@ -90,7 +90,7 @@
"| | | MIG M. |\n", "| | | MIG M. |\n",
"|===============================+======================+======================|\n", "|===============================+======================+======================|\n",
"| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n", "| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
"| N/A 55C P0 27W / 70W | 0MiB / 15109MiB | 0% Default |\n", "| N/A 64C P8 12W / 70W | 0MiB / 15109MiB | 0% Default |\n",
"| | | N/A |\n", "| | | N/A |\n",
"+-------------------------------+----------------------+----------------------+\n", "+-------------------------------+----------------------+----------------------+\n",
" \n", " \n",
@ -119,20 +119,23 @@
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"# (2) リポジトリのクローン\n", "# (2) リポジトリのクローン\n",
"!git clone --depth 1 https://github.com/w-okada/voice-changer.git -b ver_1.2\n", "!git clone --depth 1 https://github.com/w-okada/voice-changer.git -b v.1.3.0\n",
"%cd voice-changer/demo/MMVC_Trainer/monotonic_align \n", "%cd voice-changer/server\n",
"!cythonize -3 -i core.pyx &> /dev/null\n", "!git clone --depth 1 https://github.com/isletennos/MMVC_Trainer.git -b v1.3.2.2\n",
"!mv core.cpython-*.so monotonic_align &> /dev/null\n", "!cd MMVC_Trainer/monotonic_align/ && python setup.py build_ext --inplace && cd -\n",
"%cd /content/voice-changer/demo/\n",
"\n", "\n",
"!cp ../template/setting_mmvc_colab.json ../frontend/dist/assets/setting.json" "# !cythonize -3 -i core.pyx &> /dev/null\n",
"# !mv core.cpython-*.so monotonic_align &> /dev/null\n",
"# %cd /content/voice-changer/demo/\n",
"\n",
"# !cp ../template/setting_mmvc_colab.json ../frontend/dist/assets/setting.json"
], ],
"metadata": { "metadata": {
"colab": { "colab": {
"base_uri": "https://localhost:8080/" "base_uri": "https://localhost:8080/"
}, },
"id": "86wTFmqsNMnD", "id": "86wTFmqsNMnD",
"outputId": "89f55015-3adf-4fc2-a28b-837d41eebc93" "outputId": "6bf049ac-02e3-43e9-95d3-77cd42c05eb1"
}, },
"execution_count": 2, "execution_count": 2,
"outputs": [ "outputs": [
@ -141,13 +144,21 @@
"name": "stdout", "name": "stdout",
"text": [ "text": [
"Cloning into 'voice-changer'...\n", "Cloning into 'voice-changer'...\n",
"remote: Enumerating objects: 1030, done.\u001b[K\n", "remote: Enumerating objects: 138, done.\u001b[K\n",
"remote: Counting objects: 100% (1030/1030), done.\u001b[K\n", "remote: Counting objects: 100% (138/138), done.\u001b[K\n",
"remote: Compressing objects: 100% (919/919), done.\u001b[K\n", "remote: Compressing objects: 100% (119/119), done.\u001b[K\n",
"remote: Total 1030 (delta 21), reused 983 (delta 11), pack-reused 0\u001b[K\n", "remote: Total 138 (delta 18), reused 64 (delta 8), pack-reused 0\u001b[K\n",
"Receiving objects: 100% (1030/1030), 71.87 MiB | 26.24 MiB/s, done.\n", "Receiving objects: 100% (138/138), 1.51 MiB | 4.72 MiB/s, done.\n",
"Resolving deltas: 100% (21/21), done.\n", "Resolving deltas: 100% (18/18), done.\n",
"Note: checking out 'e824f89e8fac9d202d5ff72ebb13a4e1bf57b4d3'.\n", "/content/voice-changer/server\n",
"Cloning into 'MMVC_Trainer'...\n",
"remote: Enumerating objects: 920, done.\u001b[K\n",
"remote: Counting objects: 100% (920/920), done.\u001b[K\n",
"remote: Compressing objects: 100% (830/830), done.\u001b[K\n",
"remote: Total 920 (delta 4), reused 893 (delta 1), pack-reused 0\u001b[K\n",
"Receiving objects: 100% (920/920), 53.04 MiB | 33.98 MiB/s, done.\n",
"Resolving deltas: 100% (4/4), done.\n",
"Note: checking out 'f17c8c57d1ab7512633e6c57521f1eef6851bd0e'.\n",
"\n", "\n",
"You are in 'detached HEAD' state. You can look around, make experimental\n", "You are in 'detached HEAD' state. You can look around, make experimental\n",
"changes and commit them, and you can discard any commits you make in this\n", "changes and commit them, and you can discard any commits you make in this\n",
@ -158,8 +169,17 @@
"\n", "\n",
" git checkout -b <new-branch-name>\n", " git checkout -b <new-branch-name>\n",
"\n", "\n",
"/content/voice-changer/demo/MMVC_Trainer/monotonic_align\n", "Compiling core.pyx because it changed.\n",
"/content/voice-changer/demo\n" "[1/1] Cythonizing core.pyx\n",
"/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /content/voice-changer/server/MMVC_Trainer/monotonic_align/core.pyx\n",
" tree = Parsing.p_module(s, pxd, full_module_name)\n",
"running build_ext\n",
"building 'monotonic_align.core' extension\n",
"creating build\n",
"creating build/temp.linux-x86_64-3.8\n",
"x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.8/dist-packages/numpy/core/include -I/usr/include/python3.8 -c core.c -o build/temp.linux-x86_64-3.8/core.o\n",
"x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/core.o -o /content/voice-changer/server/MMVC_Trainer/monotonic_align/monotonic_align/core.cpython-38-x86_64-linux-gnu.so\n",
"/content/voice-changer/server\n"
] ]
} }
] ]
@ -179,7 +199,7 @@
"cell_type": "code", "cell_type": "code",
"source": [ "source": [
"# (3) 設定ファイルの確認\n", "# (3) 設定ファイルの確認\n",
"!apt-get install -y espeak libsndfile1-dev &> /dev/null\n", "!apt-get install -y libsndfile1-dev &> /dev/null\n",
"!pip install unidecode &> /dev/null\n", "!pip install unidecode &> /dev/null\n",
"!pip install phonemizer &> /dev/null\n", "!pip install phonemizer &> /dev/null\n",
"!pip install retry &> /dev/null\n", "!pip install retry &> /dev/null\n",
@ -188,13 +208,44 @@
"!pip install python-multipart &> /dev/null\n", "!pip install python-multipart &> /dev/null\n",
"!pip install uvicorn &> /dev/null\n", "!pip install uvicorn &> /dev/null\n",
"!pip install websockets &> /dev/null\n", "!pip install websockets &> /dev/null\n",
"!pip install pyOpenSSL &> /dev/null\n" "!pip install pyOpenSSL &> /dev/null\n",
"!pip install onnxruntime-gpu &> /dev/null"
], ],
"metadata": { "metadata": {
"id": "LwZAAuqxX7yY" "id": "LwZAAuqxX7yY",
"outputId": "42f08570-62bf-4573-bd73-f0a3bb7f4f03",
"colab": {
"base_uri": "https://localhost:8080/"
}
}, },
"execution_count": 3, "execution_count": 4,
"outputs": [] "outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Collecting onnxruntime-gpu\n",
" Downloading onnxruntime_gpu-1.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (115.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 MB\u001b[0m \u001b[31m9.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: numpy>=1.21.6 in /usr/local/lib/python3.8/dist-packages (from onnxruntime-gpu) (1.21.6)\n",
"Requirement already satisfied: packaging in /usr/local/lib/python3.8/dist-packages (from onnxruntime-gpu) (21.3)\n",
"Requirement already satisfied: protobuf in /usr/local/lib/python3.8/dist-packages (from onnxruntime-gpu) (3.19.6)\n",
"Requirement already satisfied: flatbuffers in /usr/local/lib/python3.8/dist-packages (from onnxruntime-gpu) (1.12)\n",
"Requirement already satisfied: sympy in /usr/local/lib/python3.8/dist-packages (from onnxruntime-gpu) (1.7.1)\n",
"Collecting coloredlogs\n",
" Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.0/46.0 KB\u001b[0m \u001b[31m7.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hCollecting humanfriendly>=9.1\n",
" Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m86.8/86.8 KB\u001b[0m \u001b[31m13.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging->onnxruntime-gpu) (3.0.9)\n",
"Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.8/dist-packages (from sympy->onnxruntime-gpu) (1.2.1)\n",
"Installing collected packages: humanfriendly, coloredlogs, onnxruntime-gpu\n",
"Successfully installed coloredlogs-15.0.1 humanfriendly-10.0 onnxruntime-gpu-1.13.1\n"
]
}
]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@ -239,7 +290,7 @@
"metadata": { "metadata": {
"id": "G-nMdPxEW1rc" "id": "G-nMdPxEW1rc"
}, },
"execution_count": 4, "execution_count": 5,
"outputs": [] "outputs": []
}, },
{ {
@ -254,9 +305,9 @@
"base_uri": "https://localhost:8080/" "base_uri": "https://localhost:8080/"
}, },
"id": "chu06KpAjEK6", "id": "chu06KpAjEK6",
"outputId": "93b1d4de-ed30-4203-9d42-7cab541d66e0" "outputId": "a714391f-616b-44ec-9290-c29246bc773f"
}, },
"execution_count": 5, "execution_count": 6,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
@ -266,8 +317,7 @@
"\u001b[32m PHASE3:__main__\u001b[0m\n", "\u001b[32m PHASE3:__main__\u001b[0m\n",
"\u001b[32m PHASE1:__main__\u001b[0m\n", "\u001b[32m PHASE1:__main__\u001b[0m\n",
"\u001b[17mStart MMVC SocketIO Server\u001b[0m\n", "\u001b[17mStart MMVC SocketIO Server\u001b[0m\n",
"\u001b[34m CONFIG:None, MODEL:None\u001b[0m\n", "\u001b[34m CONFIG:None, MODEL:None ONNX_MODEL:None\u001b[0m\n"
"DEBUG:asyncio:Using selector: EpollSelector\n"
] ]
} }
] ]
@ -300,15 +350,15 @@
"base_uri": "https://localhost:8080/", "base_uri": "https://localhost:8080/",
"height": 34 "height": 34
}, },
"outputId": "621e17e1-9b6b-4b9b-91d3-c8672ec14551" "outputId": "8ca21533-b852-45d5-ca3c-19f0b5d8bf1f"
}, },
"execution_count": 6, "execution_count": 7,
"outputs": [ "outputs": [
{ {
"output_type": "stream", "output_type": "stream",
"name": "stdout", "name": "stdout",
"text": [ "text": [
"https://kgz69kf9nk9-496ff2e9c6d22116-19462-colab.googleusercontent.com/front/\n" "https://3n0321xyvvj-496ff2e9c6d22116-11464-colab.googleusercontent.com/front/\n"
] ]
} }
] ]
@ -319,7 +369,7 @@
"metadata": { "metadata": {
"id": "axkt5BjhoiPV" "id": "axkt5BjhoiPV"
}, },
"execution_count": 6, "execution_count": null,
"outputs": [] "outputs": []
} }
] ]