mirror of
https://github.com/pstrueb/piper.git
synced 2026-06-02 01:47:02 +00:00
GPU now works fine in the synthesis notebook.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"colab": {
|
||||
"provenance": [],
|
||||
"gpuType": "T4",
|
||||
"authorship_tag": "ABX9TyMpLrGPwagT9tnpOUxUO8OT",
|
||||
"authorship_tag": "ABX9TyPFgeWX60dXmmKm+pi5Wr2v",
|
||||
"include_colab_link": true
|
||||
},
|
||||
"kernelspec": {
|
||||
@@ -89,6 +89,7 @@
|
||||
"!git clone -q https://github.com/rmcpantoja/piper\n",
|
||||
"%cd /content/piper/src/python\n",
|
||||
"!pip install -q -r requirements.txt\n",
|
||||
"!pip install -q onnxruntime-gpu\n",
|
||||
"!bash build_monotonic_align.sh\n",
|
||||
"!apt-get install -q espeak-ng\n",
|
||||
"import os\n",
|
||||
@@ -211,7 +212,11 @@
|
||||
" \"\"\"Main entry point\"\"\"\n",
|
||||
" models_path = \"/content/piper/src/python\"\n",
|
||||
" logging.basicConfig(level=logging.DEBUG)\n",
|
||||
" providers = [\"CPUExecutionProvider\"] if not use_gpu else ['CUDAExecutionProvider', 'CPUExecutionProvider']\n",
|
||||
" providers = [\n",
|
||||
" \"CPUExecutionProvider\"\n",
|
||||
" if use_gpu is False\n",
|
||||
" else (\"CUDAExecutionProvider\", {\"cudnn_conv_algo_search\": \"DEFAULT\"})\n",
|
||||
" ]\n",
|
||||
" sess_options = onnxruntime.SessionOptions()\n",
|
||||
" model = None\n",
|
||||
" onnx_models = detect_onnx_models(models_path)\n",
|
||||
@@ -220,7 +225,6 @@
|
||||
" description=f'{lan.translate(lang, \"Select speaker\")}:',\n",
|
||||
" layout={'visibility': 'hidden'}\n",
|
||||
" )\n",
|
||||
" display(speaker_selection)\n",
|
||||
" if onnx_models is None:\n",
|
||||
" if enhanced_accessibility:\n",
|
||||
" playaudio(\"novoices\")\n",
|
||||
@@ -283,6 +287,7 @@
|
||||
"\n",
|
||||
" load_btn.on_click(load_model)\n",
|
||||
" display(selection, load_btn)\n",
|
||||
" display(speaker_selection)\n",
|
||||
" speed_slider = widgets.FloatSlider(\n",
|
||||
" value=1,\n",
|
||||
" min=0.25,\n",
|
||||
|
||||
Reference in New Issue
Block a user