From 5ff76df072a8febe5a4c5245fa033d66e6b167db Mon Sep 17 00:00:00 2001 From: Mateo Cedillo <54605382+rmcpantoja@users.noreply.github.com> Date: Thu, 8 Jun 2023 11:20:06 -0500 Subject: [PATCH] Added accessibility stuff in the inference notebook, such as a preview of the first model downloaded. --- notebooks/piper_inference_(ONNX).ipynb | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/notebooks/piper_inference_(ONNX).ipynb b/notebooks/piper_inference_(ONNX).ipynb index f387d2f..59fa6de 100644 --- a/notebooks/piper_inference_(ONNX).ipynb +++ b/notebooks/piper_inference_(ONNX).ipynb @@ -4,7 +4,7 @@ "metadata": { "colab": { "provenance": [], - "authorship_tag": "ABX9TyMOMZhyZzFXCBGByVHUJt9Q", + "authorship_tag": "ABX9TyMXOC2oFb6GhBeA5INCKyHM", "include_colab_link": true }, "kernelspec": { @@ -210,16 +210,30 @@ " if config[\"num_speakers\"] > 1:\n", " speaker_selection.options = config[\"speaker_id_map\"].values()\n", " speaker_selection.layout.visibility = 'visible'\n", + " preview_sid = 0\n", " if enhanced_accessibility:\n", " playaudio(\"multispeaker\")\n", " else:\n", " speaker_selection.layout.visibility = 'hidden'\n", + " preview_sid = None\n", + " \n", + " if enhanced_accessibility:\n", + " inferencing(\n", + " model,\n", + " config,\n", + " preview_sid,\n", + " lan.translate(\n", + " config[\"espeak\"][\"voice\"][:2],\n", + " \"Interface openned. Write your texts, configure the different synthesis options or download all the voices you want. Enjoy!\"\n", + " )\n", + " )\n", " else:\n", " voice_model_names = []\n", " for current in onnx_models:\n", " voice_struct = current.split(\"/\")[5]\n", " voice_model_names.append(voice_struct)\n", - "\n", + " if enhanced_accessibility:\n", + " playaudio(\"selectmodel\")\n", " selection = widgets.Dropdown(\n", " options=voice_model_names,\n", " description=f'{lan.translate(lang, \"Select voice package\")}:',\n",