voice-changer/Hina_Mod_Kaggle_Real_Time_Voice_Changer.ipynb
2023-11-13 19:59:42 +08:00

2 lines
2.8 KiB
Plaintext

{"cells":[{"cell_type":"markdown","metadata":{},"source":["# Voice Changer Kaggle Ver by [Hina](https://linktr.ee/_hina__)\n","### Repo from [w-okada](https://github.com/w-okada)"]},{"cell_type":"markdown","metadata":{},"source":["### Clone Repo and Install Repo"]},{"cell_type":"code","execution_count":1,"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","execution":{"iopub.execute_input":"2023-11-13T11:43:17.161165Z","iopub.status.busy":"2023-11-13T11:43:17.160820Z","iopub.status.idle":"2023-11-13T11:48:50.214546Z","shell.execute_reply":"2023-11-13T11:48:50.213329Z","shell.execute_reply.started":"2023-11-13T11:43:17.161135Z"},"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":["Cloned\n"]}],"source":["from IPython.display import clear_output, Javascript\n","!mkdir hinabl\n","%cd hinabl\n","!git clone https://github.com/w-okada/voice-changer.git --depth=1 --quiet .\n","%cd server\n","!sed -i \"s/-.-.-.-/Kaggle.Mod/\" '../client/demo/dist/assets/gui_settings/version.txt'\n","!pip install -r requirements.txt\n","!mv MMVCServerSIO.py run.py\n","!sed -i \"s/MMVCServerSIO/run/\" run.py\n","!apt-get -y install libportaudio2 -qq\n","!pip install faiss-gpu fairseq pyngrok --quiet\n","!pip install pyworld --no-build-isolation --quiet\n","clear_output()\n","print(\"Cloned\")"]},{"cell_type":"markdown","metadata":{},"source":["### Try Run"]},{"cell_type":"code","execution_count":null,"metadata":{"execution":{"iopub.execute_input":"2023-11-13T11:49:54.280036Z","iopub.status.busy":"2023-11-13T11:49:54.279053Z"},"trusted":true},"outputs":[{"name":"stdout","output_type":"stream","text":["Server URL:https://f9c1-34-168-102-26.ngrok-free.app\n"]}],"source":["import subprocess, threading, time, socket, urllib.request\n","PORT = 8000\n","from pyngrok import conf, ngrok\n","Token=\"TokenHere\"\n","ngrok.set_auth_token(Token)\n","ngrok.region = \"ap\" # ap | au | eu | in | jp | sa | us | us-cal-1\n","ngrokConnection = ngrok.connect(PORT)\n","public_url = ngrokConnection.public_url\n","def wait_for_server():\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(\"Server URL:\"+public_url)\n","threading.Thread(target=wait_for_server, daemon=True).start()\n","!python3 run.py -p {PORT} --https False "]}],"metadata":{"kernelspec":{"display_name":"Python 3","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.12"}},"nbformat":4,"nbformat_minor":4}