Added accessibility stuff in the inference notebook, such as a preview of the first model downloaded.

This commit is contained in:
Mateo Cedillo
2023-06-08 11:20:06 -05:00
parent b85bbf06d5
commit 5ff76df072
+16 -2
View File
@@ -4,7 +4,7 @@
"metadata": { "metadata": {
"colab": { "colab": {
"provenance": [], "provenance": [],
"authorship_tag": "ABX9TyMOMZhyZzFXCBGByVHUJt9Q", "authorship_tag": "ABX9TyMXOC2oFb6GhBeA5INCKyHM",
"include_colab_link": true "include_colab_link": true
}, },
"kernelspec": { "kernelspec": {
@@ -210,16 +210,30 @@
" if config[\"num_speakers\"] > 1:\n", " if config[\"num_speakers\"] > 1:\n",
" speaker_selection.options = config[\"speaker_id_map\"].values()\n", " speaker_selection.options = config[\"speaker_id_map\"].values()\n",
" speaker_selection.layout.visibility = 'visible'\n", " speaker_selection.layout.visibility = 'visible'\n",
" preview_sid = 0\n",
" if enhanced_accessibility:\n", " if enhanced_accessibility:\n",
" playaudio(\"multispeaker\")\n", " playaudio(\"multispeaker\")\n",
" else:\n", " else:\n",
" speaker_selection.layout.visibility = 'hidden'\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", " else:\n",
" voice_model_names = []\n", " voice_model_names = []\n",
" for current in onnx_models:\n", " for current in onnx_models:\n",
" voice_struct = current.split(\"/\")[5]\n", " voice_struct = current.split(\"/\")[5]\n",
" voice_model_names.append(voice_struct)\n", " voice_model_names.append(voice_struct)\n",
"\n", " if enhanced_accessibility:\n",
" playaudio(\"selectmodel\")\n",
" selection = widgets.Dropdown(\n", " selection = widgets.Dropdown(\n",
" options=voice_model_names,\n", " options=voice_model_names,\n",
" description=f'{lan.translate(lang, \"Select voice package\")}:',\n", " description=f'{lan.translate(lang, \"Select voice package\")}:',\n",