{ "cells": [ { "cell_type": "markdown", "id": "b6ee1ede", "metadata": {}, "source": [ "## Voice Style Control Demo" ] }, { "cell_type": "code", "execution_count": 3, "id": "b7f043ee", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Importing the dtw module. When using in academic works please cite:\n", " T. Giorgino. Computing and Visualizing Dynamic Time Warping Alignments in R: The dtw Package.\n", " J. Stat. Soft., doi:10.18637/jss.v031.i07.\n", "\n" ] } ], "source": [ "import os\n", "import torch\n", "import se_extractor\n", "from api import BaseSpeakerTTS, ToneColorConverter" ] }, { "cell_type": "code", "execution_count": 2, "id": "237202b7-4e8d-4445-a5b0-41db367e4977", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/workspace/OpenVoice\n" ] } ], "source": [ "cd OpenVoice" ] }, { "cell_type": "code", "execution_count": 5, "id": "a79d4a34-ce9c-4ae3-b79a-c730b8885df6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Archive: checkpoints_1226.zip\n", " creating: checkpoints/checkpoints/\n", " creating: checkpoints/checkpoints/converter/\n", " inflating: checkpoints/checkpoints/converter/config.json \n", " inflating: checkpoints/checkpoints/converter/checkpoint.pth \n", " creating: checkpoints/checkpoints/base_speakers/\n", " creating: checkpoints/checkpoints/base_speakers/ZH/\n", " inflating: checkpoints/checkpoints/base_speakers/ZH/config.json \n", " inflating: checkpoints/checkpoints/base_speakers/ZH/checkpoint.pth \n", " inflating: checkpoints/checkpoints/base_speakers/ZH/zh_default_se.pth \n", " creating: checkpoints/checkpoints/base_speakers/EN/\n", " inflating: checkpoints/checkpoints/base_speakers/EN/config.json \n", " inflating: checkpoints/checkpoints/base_speakers/EN/en_style_se.pth \n", " inflating: checkpoints/checkpoints/base_speakers/EN/en_default_se.pth \n", " inflating: checkpoints/checkpoints/base_speakers/EN/checkpoint.pth \n" ] } ], "source": [ "!unzip checkpoints_1226.zip -d checkpoints" ] }, { "cell_type": "code", "execution_count": 7, "id": "175d6dfc-b170-46de-8a44-8ec5a4e3b333", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: huggingface_hub in /opt/conda/lib/python3.10/site-packages (0.17.3)\n", "Requirement already satisfied: filelock in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (3.13.1)\n", "Requirement already satisfied: fsspec in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (2023.12.2)\n", "Requirement already satisfied: requests in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (2.31.0)\n", "Requirement already satisfied: tqdm>=4.42.1 in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (4.65.0)\n", "Requirement already satisfied: pyyaml>=5.1 in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (6.0.1)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (4.7.1)\n", "Requirement already satisfied: packaging>=20.9 in /opt/conda/lib/python3.10/site-packages (from huggingface_hub) (23.1)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/lib/python3.10/site-packages (from requests->huggingface_hub) (2.0.4)\n", "Requirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.10/site-packages (from requests->huggingface_hub) (3.4)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.10/site-packages (from requests->huggingface_hub) (1.26.18)\n", "Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.10/site-packages (from requests->huggingface_hub) (2023.11.17)\n", "\u001b[33mWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\u001b[0m\u001b[33m\n", "\u001b[0mNote: you may need to restart the kernel to use updated packages.\n" ] } ], "source": [ "pip install huggingface_hub" ] }, { "cell_type": "code", "execution_count": 8, "id": "35b568bf-9951-40b9-843f-0af4e918567f", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f30315ee57c9418688ab0d9be585f948", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='