From 22b0f839923b5250069b786e4ff28ef2fc448762 Mon Sep 17 00:00:00 2001 From: Hina <79749008+hinabl@users.noreply.github.com> Date: Wed, 4 Oct 2023 00:12:43 +0800 Subject: [PATCH] Created using Colaboratory --- ...fied_Realtime_Voice_Changer_on_Colab.ipynb | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Hina_Modified_Realtime_Voice_Changer_on_Colab.ipynb b/Hina_Modified_Realtime_Voice_Changer_on_Colab.ipynb index 8b068ed6..8cc67ed8 100644 --- a/Hina_Modified_Realtime_Voice_Changer_on_Colab.ipynb +++ b/Hina_Modified_Realtime_Voice_Changer_on_Colab.ipynb @@ -421,6 +421,74 @@ " --samples samples.json\n", "\n" ] + }, + { + "cell_type": "markdown", + "source": [ + "![](https://i.pinimg.com/474x/de/72/9e/de729ecfa41b69901c42c82fff752414.jpg)\n", + "![](https://i.pinimg.com/474x/de/72/9e/de729ecfa41b69901c42c82fff752414.jpg)" + ], + "metadata": { + "id": "2Uu1sTSwTc7q" + } + }, + { + "cell_type": "code", + "source": [ + "# @title **[Optional]** Start Server **using localtunnel** (ngrok alternative | no account needed)\n", + "# @markdown This cell will start the server, the first time that you run it will download the models, so it can take a while (~1-2 minutes)\n", + "\n", + "# @markdown ---\n", + "!npm config set update-notifier false\n", + "!npm install -g localtunnel\n", + "print(\"\\033[92mLocalTunnel installed!\")\n", + "# @markdown If you want to automatically clear the output when the server loads, check this option.\n", + "Clear_Output = True # @param {type:\"boolean\"}\n", + "\n", + "import portpicker, subprocess, threading, time, socket, urllib.request\n", + "PORT = portpicker.pick_unused_port()\n", + "\n", + "from IPython.display import clear_output, Javascript\n", + "\n", + "def iframe_thread(port):\n", + " while True:\n", + " time.sleep(0.5)\n", + " sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n", + " result = sock.connect_ex(('127.0.0.1', port))\n", + " if result == 0:\n", + " break\n", + " sock.close()\n", + " clear_output()\n", + " print(\"Use the following endpoint to connect to localtunnel:\", urllib.request.urlopen('https://ipv4.icanhazip.com').read().decode('utf8').strip(\"\\n\"))\n", + " p = subprocess.Popen([\"lt\", \"--port\", \"{}\".format(port)], stdout=subprocess.PIPE)\n", + " for line in p.stdout:\n", + " print(line.decode(), end='')\n", + "\n", + "threading.Thread(target=iframe_thread, daemon=True, args=(PORT,)).start()\n", + "\n", + "\n", + "!python3 MMVCServerSIO.py \\\n", + " -p {PORT} \\\n", + " --https False \\\n", + " --content_vec_500 pretrain/checkpoint_best_legacy_500.pt \\\n", + " --content_vec_500_onnx pretrain/content_vec_500.onnx \\\n", + " --content_vec_500_onnx_on true \\\n", + " --hubert_base pretrain/hubert_base.pt \\\n", + " --hubert_base_jp pretrain/rinna_hubert_base_jp.pt \\\n", + " --hubert_soft pretrain/hubert/hubert-soft-0d54a1f4.pt \\\n", + " --nsf_hifigan pretrain/nsf_hifigan/model \\\n", + " --crepe_onnx_full pretrain/crepe_onnx_full.onnx \\\n", + " --crepe_onnx_tiny pretrain/crepe_onnx_tiny.onnx \\\n", + " --rmvpe pretrain/rmvpe.pt \\\n", + " --model_dir model_dir \\\n", + " --samples samples.json \\\n", + " --colab True" + ], + "metadata": { + "id": "Mr7325z-TTX5" + }, + "execution_count": null, + "outputs": [] } ], "metadata": {