voice-changer/VoiceChangerDemo_Simple.ipynb

581 lines
30 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"collapsed_sections": [],
"authorship_tag": "ABX9TyMCsjw8wsyV5UMK1mtrEFbh",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU",
"gpuClass": "standard"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/w-okada/voice-changer/blob/dev/VoiceChangerDemo_Simple.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"Voice Changer Simple (デモ版)\n",
"---\n",
"\n",
"このートはVoice ChangerをColab上で動かすデモ版です。\n",
"\n",
"正式版はローカルPCのDocker上で動かすアプリケーションです。\n",
"\n",
"正式版は、多くの場合より少ないタイムラグで滑らかに音声を変換できます。\n",
"\n",
"詳細な使用方法はこちらの[リポジトリ](https://github.com/w-okada/voice-changer)からご確認ください。\n"
],
"metadata": {
"id": "Lbbmx_Vjl0zo"
}
},
{
"cell_type": "markdown",
"source": [
"# GPUを確認\n",
"GPUを用いたほうが高速に処理が行えます。\n",
"\n",
"下記のコマンドでGPUが確認できない場合は、上のメニューから\n",
"\n",
"「ランタイム」→「ランタイムの変更」→「ハードウェア アクセラレータ」\n",
"\n",
"でGPUを選択してください。"
],
"metadata": {
"id": "oUKi1NYMmXrr"
}
},
{
"cell_type": "code",
"source": [
"# (1) GPUの確認\n",
"!nvidia-smi"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "vV1t7PBRm-o6",
"outputId": "1d41a95a-4267-41de-a993-f086ef162d39"
},
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Sat Oct 29 16:11:17 2022 \n",
"+-----------------------------------------------------------------------------+\n",
"| NVIDIA-SMI 460.32.03 Driver Version: 460.32.03 CUDA Version: 11.2 |\n",
"|-------------------------------+----------------------+----------------------+\n",
"| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
"| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n",
"| | | MIG M. |\n",
"|===============================+======================+======================|\n",
"| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |\n",
"| N/A 47C P8 11W / 70W | 0MiB / 15109MiB | 0% Default |\n",
"| | | N/A |\n",
"+-------------------------------+----------------------+----------------------+\n",
" \n",
"+-----------------------------------------------------------------------------+\n",
"| Processes: |\n",
"| GPU GI CI PID Type Process name GPU Memory |\n",
"| ID ID Usage |\n",
"|=============================================================================|\n",
"| No running processes found |\n",
"+-----------------------------------------------------------------------------+\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# 使用するモデルとコンフィグファイルの指定\n",
"\n",
"使用するトレーニング済みのモデルと、トレーニングで使用したコンフィグファイルのパスを指定してください。\n",
"\n",
"多くの場合はGoogle Driveに格納されているファイルを使用すると思います。その場合は、下の(2-2)のセルを実行してドライブをマウントしてください"
],
"metadata": {
"id": "mHvGrgaWnIPA"
}
},
{
"cell_type": "code",
"source": [
"# # (2-1) 使用するモデルとコンフィグファイルの指定\n",
"# CONFIG=\"/content/drive/MyDrive/VoiceChanger/config.json\"\n",
"# MODEL=\"/content/drive/MyDrive/VoiceChanger/G_326000.pth\""
],
"metadata": {
"id": "nSXATMWYb4Ik"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "2wxD-gRSMU5R",
"outputId": "dabd982a-87c7-44d1-b9e8-986691190771"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Mounted at /content/drive\n"
]
}
],
"source": [
"# # (2-2) Google Driveのマウント\n",
"# from google.colab import drive\n",
"# drive.mount('/content/drive')"
]
},
{
"cell_type": "markdown",
"source": [
"# リポジトリのクローン\n",
"リポジトリをクローンします"
],
"metadata": {
"id": "sLBfykjBnjWc"
}
},
{
"cell_type": "code",
"source": [
"# (3) リポジトリのクローン\n",
"!git clone --depth 1 https://github.com/isletennos/MMVC_Trainer.git -b v1.3.1.3 /MMVC_Trainer\n",
"!git clone --depth 1 https://github.com/w-okada/voice-changer.git -b dev\n",
"%cd voice-changer/demo/\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "86wTFmqsNMnD",
"outputId": "08cc7734-a82b-442e-90d2-65481abdfa06"
},
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Cloning into '/MMVC_Trainer'...\n",
"remote: Enumerating objects: 917, done.\u001b[K\n",
"remote: Counting objects: 100% (917/917), done.\u001b[K\n",
"remote: Compressing objects: 100% (828/828), done.\u001b[K\n",
"remote: Total 917 (delta 3), reused 888 (delta 0), pack-reused 0\u001b[K\n",
"Receiving objects: 100% (917/917), 53.02 MiB | 20.00 MiB/s, done.\n",
"Resolving deltas: 100% (3/3), done.\n",
"Note: checking out '39723b3243e0265b8802e020e4d4d90a4b8b65ee'.\n",
"\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",
"state without impacting any branches by performing another checkout.\n",
"\n",
"If you want to create a new branch to retain commits you create, you may\n",
"do so (now or later) by using -b with the checkout command again. Example:\n",
"\n",
" git checkout -b <new-branch-name>\n",
"\n",
"Cloning into 'voice-changer'...\n",
"remote: Enumerating objects: 87, done.\u001b[K\n",
"remote: Counting objects: 100% (87/87), done.\u001b[K\n",
"remote: Compressing objects: 100% (73/73), done.\u001b[K\n",
"remote: Total 87 (delta 15), reused 56 (delta 6), pack-reused 0\u001b[K\n",
"Unpacking objects: 100% (87/87), done.\n",
"/content/voice-changer/demo\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# ファイルの配置\n",
"アプリケーションの挙動を記した設定ファイルをコピーします(4-1)。(4-2)はコピーした設定ファイルを表示しています。もしかしたらうまく動かないときに役立つかもしれません。"
],
"metadata": {
"id": "jmDY8W_fnuSi"
}
},
{
"cell_type": "code",
"source": [
"# (4-1) 設定ファイルの配置\n",
"!cp ../template/setting_mmvc_colab.json ../frontend/dist/assets/setting.json\n"
],
"metadata": {
"id": "Bn4kV8TgXp8i"
},
"execution_count": 3,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# (4-2) 設定ファイルの確認\n",
"!cat ../frontend/dist/assets/setting.json\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "pjxPsOOaXXTj",
"outputId": "f42369d3-f4a5-460e-c20e-b72689017193"
},
"execution_count": 4,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"{\n",
" \"app_title\": \"voice-changer\",\n",
" \"majar_mode\": \"colab\",\n",
" \"voice_changer_server_url\": \"/test\",\n",
" \"sample_rate\": 48000,\n",
" \"buffer_size\": 1024,\n",
" \"prefix_chunk_size\": 36,\n",
" \"chunk_size\": 36,\n",
" \"speaker_ids\": [100, 107, 101, 102, 103],\n",
" \"speaker_names\": [\"ずんだもん\", \"user\", \"そら\", \"めたん\", \"つむぎ\"],\n",
" \"src_id\": 107,\n",
" \"dst_id\": 100,\n",
" \"vf_enable\": true,\n",
" \"voice_changer_mode\": \"realtime\",\n",
" \"gpu\": 0,\n",
" \"available_gpus\": [-1, 0, 1, 2, 3, 4],\n",
" \"avatar\": {\n",
" \"enable_avatar\": true, \n",
" \"motion_capture_face\": true,\n",
" \"motion_capture_upperbody\": true,\n",
" \"lip_overwrite_with_voice\": true,\n",
" \"avatar_url\": \"./assets/vrm/zundamon/zundamon.vrm\",\n",
" \"backgournd_image_url\": \"./assets/images/bg_natural_sougen.jpg\",\n",
" \"background_color\": \"#0000dd\",\n",
" \"chroma_key\": \"#0000dd\",\n",
" \"avatar_canvas_size\": [1280, 720],\n",
" \"screen_canvas_size\": [1280, 720]\n",
" },\n",
" \"advance\": {\n",
" \"avatar_draw_skip_rate\": 3,\n",
" \"screen_draw_skip_rate\": 3,\n",
" \"visualizer_draw_skip_rate\": 3,\n",
" \"cross_fade_lower_value\": 0.1,\n",
" \"cross_fade_offset_rate\": 0.3,\n",
" \"cross_fade_end_rate\": 0.6,\n",
" \"cross_fade_type\": 2\n",
" }\n",
"}\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# モジュールのインストール\n",
"\n",
"必要なモジュールをインストールします。"
],
"metadata": {
"id": "8Na2PbLZSWgZ"
}
},
{
"cell_type": "code",
"source": [
"# (5) 設定ファイルの確認\n",
"!apt-get install -y espeak libsndfile1-dev\n",
"!pip install unidecode\n",
"!pip install phonemizer\n",
"!pip install retry\n",
"!pip install python-socketio\n",
"!pip install fastapi\n",
"!pip install python-multipart\n",
"!pip install uvicorn\n",
"!pip install websockets\n",
"!pip install pyOpenSSL\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "LwZAAuqxX7yY",
"outputId": "ee8dc6f3-7279-4823-cd58-837e3183e088"
},
"execution_count": 14,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Reading package lists... Done\n",
"Building dependency tree \n",
"Reading state information... Done\n",
"espeak is already the newest version (1.48.04+dfsg-5).\n",
"libsndfile1-dev is already the newest version (1.0.28-4ubuntu0.18.04.2).\n",
"The following package was automatically installed and is no longer required:\n",
" libnvidia-common-460\n",
"Use 'apt autoremove' to remove it.\n",
"0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: unidecode in /usr/local/lib/python3.7/dist-packages (1.3.6)\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: phonemizer in /usr/local/lib/python3.7/dist-packages (3.2.1)\n",
"Requirement already satisfied: segments in /usr/local/lib/python3.7/dist-packages (from phonemizer) (2.2.1)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from phonemizer) (4.1.1)\n",
"Requirement already satisfied: joblib in /usr/local/lib/python3.7/dist-packages (from phonemizer) (1.2.0)\n",
"Requirement already satisfied: attrs>=18.1 in /usr/local/lib/python3.7/dist-packages (from phonemizer) (22.1.0)\n",
"Requirement already satisfied: dlinfo in /usr/local/lib/python3.7/dist-packages (from phonemizer) (1.2.1)\n",
"Requirement already satisfied: clldutils>=1.7.3 in /usr/local/lib/python3.7/dist-packages (from segments->phonemizer) (3.12.0)\n",
"Requirement already satisfied: csvw>=1.5.6 in /usr/local/lib/python3.7/dist-packages (from segments->phonemizer) (3.1.3)\n",
"Requirement already satisfied: regex in /usr/local/lib/python3.7/dist-packages (from segments->phonemizer) (2022.6.2)\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",
"Requirement already satisfied: colorlog in /usr/local/lib/python3.7/dist-packages (from clldutils>=1.7.3->segments->phonemizer) (6.7.0)\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: 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: colorama in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (0.4.6)\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: rfc3986<2 in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (1.5.0)\n",
"Requirement already satisfied: language-tags in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (1.1.0)\n",
"Requirement already satisfied: isodate in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (0.6.1)\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: requests in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (2.23.0)\n",
"Requirement already satisfied: rdflib in /usr/local/lib/python3.7/dist-packages (from csvw>=1.5.6->segments->phonemizer) (6.2.0)\n",
"Requirement already satisfied: pytz>=2015.7 in /usr/local/lib/python3.7/dist-packages (from babel->csvw>=1.5.6->segments->phonemizer) (2022.5)\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: importlib-metadata in /usr/local/lib/python3.7/dist-packages (from jsonschema->csvw>=1.5.6->segments->phonemizer) (4.13.0)\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.10.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: 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.9.0)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from rdflib->csvw>=1.5.6->segments->phonemizer) (3.3)\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: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (2022.9.24)\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: 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: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->csvw>=1.5.6->segments->phonemizer) (2.10)\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: retry in /usr/local/lib/python3.7/dist-packages (0.9.2)\n",
"Requirement already satisfied: py<2.0.0,>=1.4.26 in /usr/local/lib/python3.7/dist-packages (from retry) (1.11.0)\n",
"Requirement already satisfied: decorator>=3.4.2 in /usr/local/lib/python3.7/dist-packages (from retry) (4.4.2)\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: python-socketio in /usr/local/lib/python3.7/dist-packages (5.7.2)\n",
"Requirement already satisfied: bidict>=0.21.0 in /usr/local/lib/python3.7/dist-packages (from python-socketio) (0.22.0)\n",
"Requirement already satisfied: python-engineio>=4.3.0 in /usr/local/lib/python3.7/dist-packages (from python-socketio) (4.3.4)\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: fastapi in /usr/local/lib/python3.7/dist-packages (0.85.1)\n",
"Requirement already satisfied: starlette==0.20.4 in /usr/local/lib/python3.7/dist-packages (from fastapi) (0.20.4)\n",
"Requirement 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.10.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",
"Requirement already satisfied: anyio<5,>=3.4.0 in /usr/local/lib/python3.7/dist-packages (from starlette==0.20.4->fastapi) (3.6.2)\n",
"Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.7/dist-packages (from anyio<5,>=3.4.0->starlette==0.20.4->fastapi) (1.3.0)\n",
"Requirement 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",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Collecting python-multipart\n",
" Downloading python-multipart-0.0.5.tar.gz (32 kB)\n",
"\u001b[33mWARNING: Discarding https://files.pythonhosted.org/packages/46/40/a933ac570bf7aad12a298fc53458115cc74053474a72fbb8201d7dc06d3d/python-multipart-0.0.5.tar.gz#sha256=f7bb5f611fc600d15fa47b3974c8aa16e93724513b49b5f95c81e6624c83fa43 (from https://pypi.org/simple/python-multipart/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.\u001b[0m\n",
" Downloading python_multipart-0.0.4-py3-none-any.whl (31 kB)\n",
"Requirement already satisfied: six>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from python-multipart) (1.15.0)\n",
"Installing collected packages: python-multipart\n",
"Successfully installed python-multipart-0.0.4\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: uvicorn in /usr/local/lib/python3.7/dist-packages (0.19.0)\n",
"Requirement already satisfied: click>=7.0 in /usr/local/lib/python3.7/dist-packages (from uvicorn) (7.1.2)\n",
"Requirement already satisfied: h11>=0.8 in /usr/local/lib/python3.7/dist-packages (from uvicorn) (0.14.0)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from uvicorn) (4.1.1)\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: websockets in /usr/local/lib/python3.7/dist-packages (10.4)\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: pyOpenSSL in /usr/local/lib/python3.7/dist-packages (22.1.0)\n",
"Requirement already satisfied: cryptography<39,>=38.0.0 in /usr/local/lib/python3.7/dist-packages (from pyOpenSSL) (38.0.1)\n",
"Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.7/dist-packages (from cryptography<39,>=38.0.0->pyOpenSSL) (1.15.1)\n",
"Requirement already satisfied: pycparser in /usr/local/lib/python3.7/dist-packages (from cffi>=1.12->cryptography<39,>=38.0.0->pyOpenSSL) (2.21)\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# サーバの起動\n",
"\n",
"サーバを起動します。(6-1)\n",
"\n",
"サーバの起動状況を確認します。(6-2) \n",
"\n",
"このセルは繰り返し実行することになるのでCtrl+Retでセルを実行してください。\n",
"\n",
"アクセスできるようになるまで、1~2分かかるようです。コーヒーでも飲みに行きましょう。\n",
"\n",
"下記のようなテキストが表示されたら起動完了です。\n",
"\n",
"**`Application startup complete`**\n",
"\n",
"という文字列で完了です。`uvicorn.error`という不穏なメッセージも見られますが、これはプロセスの名前で大して重要な意味を持ちませんので無視してください。(どうやったら消せるのだろうか。)\n",
"\n",
"\n",
"```\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 [617] using StatReload\n",
"INFO:uvicorn.error:Started reloader process [617] 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",
"DEBUG:asyncio:Using selector: EpollSelector\n",
"INFO: INITIALIZE MODEL\n",
"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 [637]\n",
"INFO:uvicorn.error:Started server process [637]\n",
"INFO: Waiting for application startup.\n",
"INFO:uvicorn.error:Waiting for application startup.\n",
"INFO: Application startup complete.\n",
"INFO:uvicorn.error:Application startup complete.\n",
"```\n",
"\n"
],
"metadata": {
"id": "-_2OcN9Borke"
}
},
{
"cell_type": "code",
"source": [
"# (6-1) サーバの起動\n",
"PORT=8089\n",
"get_ipython().system_raw(f'python3 MMVCServerSIO.py -p {PORT} >foo 2>&1 &')"
],
"metadata": {
"id": "iNOAB7zISI6J"
},
"execution_count": 15,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# (6-2) サーバの起動確認 (Ctrl+Retで実行)\n",
"!tail -30 foo"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "chu06KpAjEK6",
"outputId": "052f6098-2370-4740-9d5f-37087524db1b"
},
"execution_count": 17,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Traceback (most recent call last):\n",
" File \"MMVCServerSIO.py\", line 22, in <module>\n",
" from mods.VoiceChanger import VoiceChanger\n",
" File \"/content/voice-changer/demo/mods/VoiceChanger.py\", line 9, in <module>\n",
" from text.symbols import symbols\n",
" File \"/MMVC_Trainer/text/__init__.py\", line 2, in <module>\n",
" from text import cleaners\n",
" File \"/MMVC_Trainer/text/cleaners.py\", line 18, in <module>\n",
" from phonemizer import phonemize\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/__init__.py\", line 36, in <module>\n",
" from .phonemize import phonemize # pylint: disable=unused-import\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/phonemize.py\", line 30, in <module>\n",
" from phonemizer.backend import BACKENDS\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/backend/__init__.py\", line 19, in <module>\n",
" from .espeak.espeak import EspeakBackend\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/backend/espeak/espeak.py\", line 22, in <module>\n",
" from phonemizer.backend.espeak.base import BaseEspeakBackend\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/backend/espeak/base.py\", line 21, in <module>\n",
" from phonemizer.backend.base import BaseBackend\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/backend/base.py\", line 26, in <module>\n",
" from phonemizer.punctuation import Punctuation\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/punctuation.py\", line 21, in <module>\n",
" from phonemizer.utils import str2list\n",
" File \"/usr/local/lib/python3.7/dist-packages/phonemizer/utils.py\", line 22, in <module>\n",
" import pkg_resources\n",
" File \"/usr/local/lib/python3.7/dist-packages/pkg_resources.py\", line 1479, in <module>\n",
" register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)\n",
"AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# プロキシを起動\n",
"ウェブサーバへのアクセスをするためのプロキシを起動します。\n",
"\n",
"表示されたURLをクリックして開くと別タブでアプリが開きます。\n",
"\n",
"Colabなので、ロードにある程度時間がかかります(30秒くらい)。"
],
"metadata": {
"id": "WhxcFLQEpctq"
}
},
{
"cell_type": "code",
"source": [
"# (7) プロキシを起動\n",
"from google.colab.output import eval_js\n",
"proxy = eval_js( \"google.colab.kernel.proxyPort(\" + str(PORT) + \")\" )\n",
"print(f\"{proxy}front/\")"
],
"metadata": {
"id": "nkRjZm95l87C",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 34
},
"outputId": "0af21153-44de-43a9-ac84-0f6644b3bf06"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"https://y6buvnj4vvr-496ff2e9c6d22116-8089-colab.googleusercontent.com/front/\n"
]
}
]
}
]
}