Model exporter improvements.

pull/88/head
Mateo Cedillo 1 year ago
parent 5ff76df072
commit d68f0ed0cf

@ -5,7 +5,7 @@
"colab": {
"provenance": [],
"gpuType": "T4",
"authorship_tag": "ABX9TyN4A5uP0tIg9xc15nyLxbO2",
"authorship_tag": "ABX9TyMa35BjcTXUjkrGNFRh72WA",
"include_colab_link": true
},
"kernelspec": {
@ -31,6 +31,7 @@
"cell_type": "markdown",
"source": [
"# [Piper](https://github.com/rhasspy/piper) model exporter\n",
"## ![Piper logo](https://contribute.rhasspy.org/img/logo.png)\n",
"\n",
"Notebook created by [rmcpantoja](http://github.com/rmcpantoja)"
],
@ -71,14 +72,18 @@
"from google.colab import output\n",
"guideurl = \"https://github.com/rmcpantoja/piper/blob/master/notebooks/wav/en\"\n",
"#@markdown #### Download:\n",
"#@markdown **Google Drive model ID:**\n",
"#@markdown **Drive ID or direct download link of the model in another cloud:**\n",
"model_id = \"\" #@param {type:\"string\"}\n",
"#@markdown **Config.json Google Drive ID**\n",
"#@markdown **Drive ID or direct download link of the config.json file:**\n",
"config_id = \"\" #@param {type:\"string\"}\n",
"#@markdown ---\n",
"\n",
"#@markdown #### Creation process:\n",
"language = \"en-us\" #@param [\"en-us\", \"es\", \"fr\"]\n",
"#@markdown **Choose the language code (iso639-1 format):**\n",
"\n",
"#@markdown You can see a list of language codes and names [here](https://www.loc.gov/standards/iso639-2/php/English_list.php)\n",
"\n",
"language = \"en-us\" #@param [\"ca\", \"da\", \"de\", \"en\", \"en-us\", \"es\", \"fi\", \"fr\", \"grc\", \"is\", \"it\", \"k\", \"nb\", \"ne\", \"nl\", \"pl\", \"pt-br\", \"ru\", \"sv\", \"uk\", \"vi-vn-x-central\", \"yue\"]\n",
"voice_name = \"myvoice\" #@param {type:\"string\"}\n",
"voice_name = voice_name.lower()\n",
"quality = \"medium\" #@param [\"high\", \"low\", \"medium\", \"x-low\"]\n",
@ -90,8 +95,18 @@
"if not os.path.exists(packages_path):\n",
" os.makedirs(packages_path)\n",
"print(\"Downloading model and his config...\")\n",
"!gdown -q \"{model_id}\" -O /content/project/model.ckpt\n",
"!gdown -q \"{config_id}\" -O \"{export_voice_path}/{export_voice_name}.onnx.json\"\n",
"if model_id.startswith(\"1\"):\n",
" !gdown -q \"{model_id}\" -O /content/project/model.ckpt\n",
"elif model_id.startswith(\"https://drive.google.com/file/d/\"):\n",
" !gdown \"{model_id}\" -O \"/content/project/model.ckpt\" --fuzzy\n",
"else:\n",
" !wget \"{model_id}\" -O \"/content/project/model.ckpt\"\n",
"if config_id.startswith(\"1\"):\n",
" !gdown -q \"{config_id}\" -O \"{export_voice_path}/{export_voice_name}.onnx.json\"\n",
"elif config_id.startswith(\"https://drive.google.com/file/d/\"):\n",
" !gdown -q \"{config_id}\" -O \"{export_voice_path}/{export_voice_name}.onnx.json\" --fuzzy\n",
"else:\n",
" !wget \"{config_id}\" -O \"{export_voice_path}/{export_voice_name}.onnx.json\"\n",
"#@markdown **Do you want to write a model card?**\n",
"write_model_card = True #@param {type:\"boolean\"}\n",
"if write_model_card:\n",
@ -151,9 +166,9 @@
{
"cell_type": "markdown",
"source": [
"# I want to test this model!\n",
"# I want to test this model! I don't need anything else anymore?\n",
"\n",
"Sure! You can upload your generated package to your friends, to a cloud storage and test it on:\n",
"No, this is almost the end! Now you can share your generated package to your friends, upload to a cloud storage and/or test it on:\n",
"* [The inference notebook](https://colab.research.google.com/github/rmcpantoja/piper/blob/master/notebooks/piper_inference_(ONNX).ipynb)\n",
" * run the cells in order for it to work correctly, as well as all the notebooks. Also, the inference notebook will guide you through the process using the enhanced accessibility feature if you wish. It's easy to use. Test it!\n",
"* Or through the NVDA screen reader!\n",

Loading…
Cancel
Save