diff --git a/notebooks/piper_multilingual_training_notebook.ipynb b/notebooks/piper_multilingual_training_notebook.ipynb index c156b0e..4001140 100644 --- a/notebooks/piper_multilingual_training_notebook.ipynb +++ b/notebooks/piper_multilingual_training_notebook.ipynb @@ -5,7 +5,6 @@ "colab": { "provenance": [], "gpuType": "T4", - "authorship_tag": "ABX9TyN5orawFZNYEhhbtJPe+1fd", "include_colab_link": true }, "kernelspec": { @@ -32,10 +31,13 @@ { "cell_type": "markdown", "source": [ - "# [Piper](https://github.com/rhasspy/piper) training notebook\n", - "## ![Piper](https://contribute.rhasspy.org/img/logo.png)\n", + "# **[Piper](https://github.com/rhasspy/piper) training notebook.**\n", + "## ![Piper logo](https://contribute.rhasspy.org/img/logo.png)\n", "\n", - "Notebook made by [rmcpantoja](http://github.com/rmcpantoja)" + "---\n", + "\n", + "- Notebook made by [rmcpantoja](http://github.com/rmcpantoja)\n", + "- Collaborator: [Xx_Nessu_xX](https://fakeyou.com/profile/Xx_Nessu_xX)" ], "metadata": { "id": "eK3nmYDB6C1a" @@ -44,7 +46,7 @@ { "cell_type": "markdown", "source": [ - "# First steps" + "# 🔧 ***First steps.*** 🔧" ], "metadata": { "id": "AICh6p5OJybj" @@ -53,7 +55,7 @@ { "cell_type": "code", "source": [ - "#@markdown ## **Google Colab Anti-Disconnect.**\n", + "#@markdown ## **Google Colab Anti-Disconnect.** 🔌\n", "#@markdown ---\n", "#@markdown #### Avoid automatic disconnection. Still, it will disconnect after **6 to 12 hours**.\n", "\n", @@ -77,7 +79,7 @@ { "cell_type": "code", "source": [ - "#@markdown ## Check GPU type\n", + "#@markdown ## **Check GPU type.** 👁️\n", "#@markdown ---\n", "#@markdown #### A higher capable GPU can lead to faster training speeds. By default, you will have a **Tesla T4**.\n", "!nvidia-smi" @@ -98,7 +100,7 @@ }, "outputs": [], "source": [ - "#@markdown ## mount Google Drive\n", + "#@markdown # **Mount Google Drive.** 📂\n", "from google.colab import drive\n", "drive.mount('/content/drive', force_remount=True)" ] @@ -106,10 +108,10 @@ { "cell_type": "code", "source": [ - "#@markdown ## Install software\n", - "#@markdown In this cell the synthesizer and its necessary dependencies to execute the training will be installed. (this may take a while)\n", + "#@markdown # **Install software.** 📦\n", + "#@markdown ####In this cell the synthesizer and its necessary dependencies to execute the training will be installed. (this may take a while)\n", "\n", - "#@markdown **Note: Please restart the runtime environment when the cell execution is finished. Then you can continue with the training section.**\n", + "#@markdown **Note: Please restart the runtime environment when the cell execution is finished. Then you can continue with the training section.**\n", "\n", "# clone:\n", "!git clone https://github.com/rmcpantoja/piper\n", @@ -133,7 +135,7 @@ { "cell_type": "markdown", "source": [ - "# Training" + "# 🤖 ***Training.*** 🤖" ], "metadata": { "id": "A3bMzEE0V5Ma" @@ -142,8 +144,8 @@ { "cell_type": "code", "source": [ - "#@markdown ## 1. Extract dataset\n", - "#@markdown **Important: the audios must be in wav format, (16000 or 22050hz, 16-bits, mono), and, for convenience, numbered. Example:**\n", + "#@markdown # **1. Extract dataset.** 📥\n", + "#@markdown ####Important: the audios must be in **wav format, (16000 or 22050hz, 16-bits, mono), and, for convenience, numbered. Example:**\n", "\n", "#@markdown * **1.wav**\n", "#@markdown * **2.wav**\n", @@ -171,14 +173,15 @@ { "cell_type": "code", "source": [ - "#@markdown ## 2. Upload the transcript file\n", - "#@markdown Important: the transcription means writing what the character says in each of the audios, and it must have the following structure:\n", + "#@markdown # **2. Upload the transcript file.** 📝\n", + "#@markdown ---\n", + "#@markdown ####Important: the transcription means writing what the character says in each of the audios, and it must have the following structure:\n", "\n", "#@markdown * wavs/1.wav|This is what my character says in audio 1.\n", "#@markdown * wavs/2.wav|This, the text that the character says in audio 2.\n", - "#@markdown * ...............\n", + "#@markdown * ...\n", "\n", - "#@markdown And so on. In addition, the transcript must be in a .csv format (UTF8 without bom)\n", + "#@markdown And so on. In addition, the transcript must be in a .csv format. (UTF-8 without BOM)\n", "\n", "%cd /content/dataset\n", "from google.colab import files\n", @@ -198,7 +201,7 @@ { "cell_type": "code", "source": [ - "#@markdown ## 3. Preprocess dataset\n", + "#@markdown # **3. Preprocess dataset.** 🔄\n", "\n", "import os\n", "#@markdown ### First of all, select the language of your dataset.\n", @@ -238,7 +241,7 @@ "model_name = \"Test\" #@param {type:\"string\"}\n", "#@markdown ---\n", "# output:\n", - "#@markdown ### Choose the working folder. (recommended to save to Drive)\n", + "#@markdown ### Choose the working folder: (recommended to save to Drive)\n", "\n", "#@markdown The working folder will be used in preprocessing, but also in training the model.\n", "output_path = \"/content/drive/MyDrive/colab/piper\" #@param {type:\"string\"}\n", @@ -246,7 +249,7 @@ "if not os.path.exists(output_dir):\n", " os.makedirs(output_dir)\n", "#@markdown ---\n", - "#@markdown ### Choose dataset format\n", + "#@markdown ### Choose dataset format:\n", "dataset_format = \"ljspeech\" #@param [\"ljspeech\", \"mycroft\"]\n", "#@markdown ---\n", "#@markdown ### Is this a single speaker dataset? Otherwise, uncheck:\n", @@ -256,7 +259,7 @@ "else:\n", " force_sp = \"\"\n", "#@markdown ---\n", - "#@markdown ### Select the sample rate of the dataset\n", + "#@markdown ### Select the sample rate of the dataset:\n", "sample_rate = \"16000\" #@param [\"16000\", \"22050\"]\n", "#@markdown ---\n", "%cd /content/piper/src/python\n", @@ -278,7 +281,7 @@ { "cell_type": "code", "source": [ - "#@markdown ## 4. Settings\n", + "#@markdown # **4. Settings.** 🧰\n", "import json\n", "import ipywidgets as widgets\n", "from IPython.display import display\n", @@ -309,10 +312,10 @@ " raise Exception(\"The pretrained_models.json file was not found.\")\n", "else:\n", " ft_command = \"\"\n", - "#@markdown ### Choose batch size based on this dataset\n", + "#@markdown ### Choose batch size based on this dataset:\n", "batch_size = 16 #@param {type:\"integer\"}\n", "#@markdown ---\n", - "#@markdown ### Validation split\n", + "#@markdown ### Validation split:\n", "validation_split = 0.03 #@param {type:\"number\"}\n", "#@markdown ---\n", "#@markdown ### Choose the quality for this model:\n", @@ -326,10 +329,10 @@ "#@markdown ### For how many epochs to save training checkpoints?\n", "checkpoint_epochs = 25 #@param {type:\"integer\"}\n", "#@markdown ---\n", - "#@markdown ### Step interval to generate model samples\n", + "#@markdown ### Step interval to generate model samples:\n", "log_every_n_steps = 250 #@param {type:\"integer\"}\n", "#@markdown ---\n", - "#@markdown ### training epochs\n", + "#@markdown ### Training epochs:\n", "max_epochs = 10000 #@param {type:\"integer\"}\n", "#@markdown ---" ], @@ -343,9 +346,9 @@ { "cell_type": "code", "source": [ - "#@markdown ## 5. Run the tensorboard extension\n", + "#@markdown # **5. Run the TensorBoard extension.** 📈\n", "\n", - "#@markdown The tensorboard is used to visualize the results of the model while it is being trained.\n", + "#@markdown The TensorBoard is used to visualize the results of the model while it is being trained.\n", "%load_ext tensorboard\n", "%tensorboard --logdir {output_dir}" ], @@ -359,9 +362,9 @@ { "cell_type": "code", "source": [ - "#@markdown ## 6. Train\n", + "#@markdown # **6. Train.** 🏋️‍♂️\n", "\n", - "#@markdown **Note: Remember to empty the trash of your Drive from time to time to avoid a lot of space consumption when saving the models.**\n", + "#@markdown **Note: Remember to empty the trash of your Drive from time to time to avoid a lot of space consumption when saving the models.**\n", "!python -m piper_train \\\n", " --dataset-dir \"{output_dir}\" \\\n", " --accelerator 'gpu' \\\n", @@ -371,8 +374,7 @@ " --num-test-examples 2 \\\n", " --quality {quality} \\\n", " --checkpoint-epochs {checkpoint_epochs} \\\n", - " --check_val_every_n_epoch 25 \\\n", - " --num_sanity_val_steps 1000 \\\n", + " --check_val_every_n_epoch {checkpoint_epochs} \\\n", " --log_every_n_steps {log_every_n_steps} \\\n", " --max_epochs {max_epochs} \\\n", " {ft_command}\\\n", @@ -384,6 +386,17 @@ }, "execution_count": null, "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Have you finished training and want to test the model?\n", + "\n", + "Export your model using the [model exporter notebook](https://colab.research.google.com/github/rmcpantoja/piper/blob/master/notebooks/piper_model_exporter.ipynb)!" + ], + "metadata": { + "id": "6ISG085SYn85" + } } ] } \ No newline at end of file