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

This commit is contained in:
w-okada 2022-09-19 06:21:40 +09:00
parent 76bbd05354
commit e869c44228

View File

@ -6,7 +6,7 @@
"name": "VoiceChangerDemo",
"provenance": [],
"collapsed_sections": [],
"authorship_tag": "ABX9TyMnmljx6Vcud0r/IwjCrzBW",
"authorship_tag": "ABX9TyPQVvmTXG6Vvab5wZAa6lKO",
"include_colab_link": true
},
"kernelspec": {
@ -75,7 +75,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "vV1t7PBRm-o6",
"outputId": "033cdd79-1aa3-436c-a99d-a01ca35d8757"
"outputId": "ab215746-b0f6-4efc-e7bd-d05a2d88d28e"
},
"execution_count": 1,
"outputs": [
@ -83,7 +83,7 @@
"output_type": "stream",
"name": "stdout",
"text": [
"Sun Sep 18 21:11:39 2022 \n",
"Sun Sep 18 21:17:24 2022 \n",
"+-----------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n",
"|-------------------------------+----------------------+----------------------+\n",
@ -92,7 +92,7 @@
"| | | MIG M. |\n",
"|===============================+======================+======================|\n",
"| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
"| N/A 42C P8 9W / 70W | 0MiB / 15109MiB | 0% Default |\n",
"| N/A 45C P8 10W / 70W | 0MiB / 15109MiB | 0% Default |\n",
"| | | N/A |\n",
"+-------------------------------+----------------------+----------------------+\n",
" \n",
@ -141,7 +141,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "2wxD-gRSMU5R",
"outputId": "d0f2beee-9d62-4832-d2a5-565b38718731"
"outputId": "88042619-b3bd-4a2f-da14-618a84f0180b"
},
"outputs": [
{
@ -180,7 +180,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "86wTFmqsNMnD",
"outputId": "22a1773c-6642-4412-e292-f753c5000bc2"
"outputId": "8176d9e8-8b4a-4802-ff64-81e3fddf50bb"
},
"execution_count": 4,
"outputs": [
@ -189,12 +189,12 @@
"name": "stdout",
"text": [
"Cloning into 'voice-changer'...\n",
"remote: Enumerating objects: 591, done.\u001b[K\n",
"remote: Counting objects: 100% (175/175), done.\u001b[K\n",
"remote: Compressing objects: 100% (138/138), done.\u001b[K\n",
"remote: Total 591 (delta 70), reused 71 (delta 35), pack-reused 416\u001b[K\n",
"Receiving objects: 100% (591/591), 23.57 MiB | 9.38 MiB/s, done.\n",
"Resolving deltas: 100% (297/297), done.\n",
"remote: Enumerating objects: 101, done.\u001b[K\n",
"remote: Counting objects: 100% (101/101), done.\u001b[K\n",
"remote: Compressing objects: 100% (87/87), done.\u001b[K\n",
"remote: Total 101 (delta 13), reused 70 (delta 6), pack-reused 0\u001b[K\n",
"Receiving objects: 100% (101/101), 18.97 MiB | 22.69 MiB/s, done.\n",
"Resolving deltas: 100% (13/13), done.\n",
"/content/voice-changer/demo\n"
]
}
@ -233,7 +233,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "pjxPsOOaXXTj",
"outputId": "62d019ab-921d-4c1c-f6dd-2e7c354bb453"
"outputId": "9b387b49-034a-43ad-9fb2-1437504b5821"
},
"execution_count": 6,
"outputs": [
@ -310,7 +310,7 @@
"base_uri": "https://localhost:8080/"
},
"id": "LwZAAuqxX7yY",
"outputId": "5a4091f0-7301-4ad4-e6da-5e16fdcaf67a"
"outputId": "3c4e46d7-e889-4713-c4bd-04734141bcb6"
},
"execution_count": 7,
"outputs": [
@ -337,7 +337,7 @@
"Get:3 http://archive.ubuntu.com/ubuntu bionic/universe amd64 espeak-data amd64 1.48.04+dfsg-5 [934 kB]\n",
"Get:4 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libespeak1 amd64 1.48.04+dfsg-5 [145 kB]\n",
"Get:5 http://archive.ubuntu.com/ubuntu bionic/universe amd64 espeak amd64 1.48.04+dfsg-5 [61.6 kB]\n",
"Fetched 1,219 kB in 2s (696 kB/s)\n",
"Fetched 1,219 kB in 0s (3,033 kB/s)\n",
"Selecting previously unselected package libportaudio2:amd64.\n",
"(Reading database ... 155569 files and directories currently installed.)\n",
"Preparing to unpack .../libportaudio2_19.6.0-1_amd64.deb ...\n",
@ -364,60 +364,60 @@
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Collecting unidecode\n",
" Downloading Unidecode-1.3.4-py3-none-any.whl (235 kB)\n",
"\u001b[K |████████████████████████████████| 235 kB 29.4 MB/s \n",
"\u001b[K |████████████████████████████████| 235 kB 4.8 MB/s \n",
"\u001b[?25hInstalling collected packages: unidecode\n",
"Successfully installed unidecode-1.3.4\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Collecting phonemizer\n",
" Downloading phonemizer-3.2.1-py3-none-any.whl (90 kB)\n",
"\u001b[K |████████████████████████████████| 90 kB 8.6 MB/s \n",
"\u001b[?25hRequirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from phonemizer) (4.1.1)\n",
"Requirement already satisfied: attrs>=18.1 in /usr/local/lib/python3.7/dist-packages (from phonemizer) (22.1.0)\n",
"Collecting segments\n",
" Downloading segments-2.2.1-py2.py3-none-any.whl (15 kB)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.7/dist-packages (from phonemizer) (1.1.0)\n",
"\u001b[K |████████████████████████████████| 90 kB 4.3 MB/s \n",
"\u001b[?25hRequirement already satisfied: attrs>=18.1 in /usr/local/lib/python3.7/dist-packages (from phonemizer) (22.1.0)\n",
"Collecting dlinfo\n",
" Downloading dlinfo-1.2.1-py3-none-any.whl (3.6 kB)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.7/dist-packages (from phonemizer) (1.1.0)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from phonemizer) (4.1.1)\n",
"Collecting segments\n",
" Downloading segments-2.2.1-py2.py3-none-any.whl (15 kB)\n",
"Collecting clldutils>=1.7.3\n",
" Downloading clldutils-3.12.0-py2.py3-none-any.whl (197 kB)\n",
"\u001b[K |████████████████████████████████| 197 kB 64.1 MB/s \n",
"\u001b[?25hRequirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from segments->phonemizer) (2022.6.2)\n",
"Collecting csvw>=1.5.6\n",
"\u001b[K |████████████████████████████████| 197 kB 27.4 MB/s \n",
"\u001b[?25hCollecting csvw>=1.5.6\n",
" Downloading csvw-3.1.1-py2.py3-none-any.whl (56 kB)\n",
"\u001b[K |████████████████████████████████| 56 kB 4.7 MB/s \n",
"\u001b[?25hRequirement already satisfied: tabulate>=0.7.7 in /usr/local/lib/python3.7/dist-packages (from clldutils>=1.7.3->segments->phonemizer) (0.8.10)\n",
"\u001b[K |████████████████████████████████| 56 kB 4.9 MB/s \n",
"\u001b[?25hRequirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from segments->phonemizer) (2022.6.2)\n",
"Requirement already satisfied: tabulate>=0.7.7 in /usr/local/lib/python3.7/dist-packages (from clldutils>=1.7.3->segments->phonemizer) (0.8.10)\n",
"Requirement already satisfied: python-dateutil in /usr/local/lib/python3.7/dist-packages (from clldutils>=1.7.3->segments->phonemizer) (2.8.2)\n",
"Collecting colorlog\n",
" Downloading colorlog-6.7.0-py2.py3-none-any.whl (11 kB)\n",
"Collecting colorama\n",
" Downloading colorama-0.4.5-py2.py3-none-any.whl (16 kB)\n",
"Collecting rdflib\n",
" Downloading rdflib-6.2.0-py3-none-any.whl (500 kB)\n",
"\u001b[K |████████████████████████████████| 500 kB 62.0 MB/s \n",
"\u001b[?25hRequirement already satisfied: babel in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (2.10.3)\n",
"Requirement already satisfied: uritemplate>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (3.0.1)\n",
"Collecting language-tags\n",
" Downloading language_tags-1.1.0-py2.py3-none-any.whl (210 kB)\n",
"\u001b[K |████████████████████████████████| 210 kB 71.3 MB/s \n",
"\u001b[?25hCollecting isodate\n",
" Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)\n",
"\u001b[K |████████████████████████████████| 41 kB 682 kB/s \n",
"\u001b[K |████████████████████████████████| 210 kB 58.6 MB/s \n",
"\u001b[?25hRequirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (2.23.0)\n",
"Collecting colorama\n",
" Downloading colorama-0.4.5-py2.py3-none-any.whl (16 kB)\n",
"Collecting rfc3986<2\n",
" Downloading rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)\n",
"Collecting rdflib\n",
" Downloading rdflib-6.2.0-py3-none-any.whl (500 kB)\n",
"\u001b[K |████████████████████████████████| 500 kB 59.1 MB/s \n",
"\u001b[?25hCollecting isodate\n",
" Downloading isodate-0.6.1-py2.py3-none-any.whl (41 kB)\n",
"\u001b[K |████████████████████████████████| 41 kB 649 kB/s \n",
"\u001b[?25hRequirement already satisfied: uritemplate>=3.0.0 in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (3.0.1)\n",
"Requirement already satisfied: babel in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (2.10.3)\n",
"Requirement already satisfied: jsonschema in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (4.3.3)\n",
"Requirement already satisfied: pytz>=2015.7 in /usr/local/lib/python3.7/dist-packages (from babel->csvw>=1.5.6->segments->phonemizer) (2022.2.1)\n",
"Requirement already satisfied: six in /usr/local/lib/python3.7/dist-packages (from isodate->csvw>=1.5.6->segments->phonemizer) (1.15.0)\n",
"Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer) (0.18.1)\n",
"Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer) (4.12.0)\n",
"Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer) (0.18.1)\n",
"Requirement already satisfied: importlib-resources>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer) (5.9.0)\n",
"Requirement already satisfied: zipp>=3.1.0 in /usr/local/lib/python3.7/dist-packages (from importlib-resources>=1.4.0->jsonschema->csvw>=1.5.6->segments->phonemizer) (3.8.1)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from rdflib->csvw>=1.5.6->segments->phonemizer) (57.4.0)\n",
"Requirement already satisfied: pyparsing in /usr/local/lib/python3.7/dist-packages (from rdflib->csvw>=1.5.6->segments->phonemizer) (3.0.9)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (2.10)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (2022.6.15)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (3.0.4)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (1.24.3)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (2022.6.15)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (2.10)\n",
"Installing collected packages: isodate, rfc3986, rdflib, language-tags, colorama, csvw, colorlog, clldutils, segments, dlinfo, phonemizer\n",
"Successfully installed clldutils-3.12.0 colorama-0.4.5 colorlog-6.7.0 csvw-3.1.1 dlinfo-1.2.1 isodate-0.6.1 language-tags-1.1.0 phonemizer-3.2.1 rdflib-6.2.0 rfc3986-1.5.0 segments-2.2.1\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
@ -430,15 +430,15 @@
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Collecting fastapi\n",
" Downloading fastapi-0.85.0-py3-none-any.whl (55 kB)\n",
"\u001b[K |████████████████████████████████| 55 kB 3.8 MB/s \n",
"\u001b[K |████████████████████████████████| 55 kB 2.2 MB/s \n",
"\u001b[?25hCollecting starlette==0.20.4\n",
" Downloading starlette-0.20.4-py3-none-any.whl (63 kB)\n",
"\u001b[K |████████████████████████████████| 63 kB 2.5 MB/s \n",
"\u001b[K |████████████████████████████████| 63 kB 2.3 MB/s \n",
"\u001b[?25hRequirement already satisfied: pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 in /usr/local/lib/python3.7/dist-packages (from fastapi) (1.9.2)\n",
"Requirement already satisfied: typing-extensions>=3.10.0 in /usr/local/lib/python3.7/dist-packages (from starlette==0.20.4->fastapi) (4.1.1)\n",
"Collecting anyio<5,>=3.4.0\n",
" Downloading anyio-3.6.1-py3-none-any.whl (80 kB)\n",
"\u001b[K |████████████████████████████████| 80 kB 11.3 MB/s \n",
"\u001b[K |████████████████████████████████| 80 kB 9.1 MB/s \n",
"\u001b[?25hRequirement already satisfied: idna>=2.8 in /usr/local/lib/python3.7/dist-packages (from anyio<5,>=3.4.0->starlette==0.20.4->fastapi) (2.10)\n",
"Collecting sniffio>=1.1\n",
" Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)\n",
@ -447,13 +447,13 @@
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Collecting uvicorn\n",
" Downloading uvicorn-0.18.3-py3-none-any.whl (57 kB)\n",
"\u001b[K |████████████████████████████████| 57 kB 5.4 MB/s \n",
"\u001b[?25hCollecting h11>=0.8\n",
"\u001b[K |████████████████████████████████| 57 kB 2.8 MB/s \n",
"\u001b[?25hRequirement already satisfied: click>=7.0 in /usr/local/lib/python3.7/dist-packages (from uvicorn) (7.1.2)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from uvicorn) (4.1.1)\n",
"Collecting h11>=0.8\n",
" Downloading h11-0.13.0-py3-none-any.whl (58 kB)\n",
"\u001b[K |████████████████████████████████| 58 kB 6.6 MB/s \n",
"\u001b[?25hRequirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from uvicorn) (4.1.1)\n",
"Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.7/dist-packages (from uvicorn) (7.1.2)\n",
"Installing collected packages: h11, uvicorn\n",
"\u001b[K |████████████████████████████████| 58 kB 5.8 MB/s \n",
"\u001b[?25hInstalling collected packages: h11, uvicorn\n",
"Successfully installed h11-0.13.0 uvicorn-0.18.3\n"
]
}
@ -508,38 +508,34 @@
"metadata": {
"id": "iNOAB7zISI6J"
},
"execution_count": 10,
"execution_count": 8,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# (6-2) サーバの起動確認 (Ctrl+Retで実行)\n",
"!cat foo"
"!tail -20 foo"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "chu06KpAjEK6",
"outputId": "ed8791b6-d2fa-42c5-bb3b-177973b8b835"
"outputId": "cc836667-5f87-49a2-e6f1-397c10d28a7e"
},
"execution_count": 19,
"execution_count": 14,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"INFO:uvicorn:INITIALIZE MODEL\n",
"GPU_NUM: 1\n",
"INFO:root:Loaded checkpoint '/content/drive/MyDrive/VoiceChanger/G_326000.pth' (iteration 1136)\n",
"INFO:uvicorn:START APP\n",
"INFO: Will watch for changes in these directories: ['/content/voice-changer/demo']\n",
"INFO:uvicorn.error:Will watch for changes in these directories: ['/content/voice-changer/demo']\n",
"INFO: Uvicorn running on http://0.0.0.0:8088 (Press CTRL+C to quit)\n",
"INFO:uvicorn.error:Uvicorn running on http://0.0.0.0:8088 (Press CTRL+C to quit)\n",
"INFO: Started reloader process [646] using StatReload\n",
"INFO:uvicorn.error:Started reloader process [646] using StatReload\n",
"INFO: Started reloader process [633] using StatReload\n",
"INFO:uvicorn.error:Started reloader process [633] using StatReload\n",
"INFO:uvicorn:INITIALIZE MODEL\n",
"GPU_NUM: 1\n",
"INFO:root:Loaded checkpoint '/content/drive/MyDrive/VoiceChanger/G_326000.pth' (iteration 1136)\n",
@ -548,8 +544,8 @@
"INFO:uvicorn:INITIALIZE MODEL\n",
"GPU_NUM: 1\n",
"INFO:root:Loaded checkpoint '/content/drive/MyDrive/VoiceChanger/G_326000.pth' (iteration 1136)\n",
"INFO: Started server process [666]\n",
"INFO:uvicorn.error:Started server process [666]\n",
"INFO: Started server process [654]\n",
"INFO:uvicorn.error:Started server process [654]\n",
"INFO: Waiting for application startup.\n",
"INFO:uvicorn.error:Waiting for application startup.\n",
"INFO: Application startup complete.\n",
@ -586,15 +582,15 @@
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "02961b25-a5fc-4e46-bca2-c834b4f00f59"
"outputId": "ec343c63-c165-4375-d7a4-05b02c3c36b1"
},
"execution_count": 20,
"execution_count": 15,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"https://efftd8s2tmd-496ff2e9c6d22116-8088-colab.googleusercontent.com/front/\n"
"https://1bhiamr2dnh-496ff2e9c6d22116-8088-colab.googleusercontent.com/front/\n"
]
}
]