Skip to content

Commit

Permalink
update onnx export so users doesnt have to run extract data prior to it
Browse files Browse the repository at this point in the history
  • Loading branch information
MLo7Ghinsan committed Sep 4, 2023
1 parent 5d8ce4b commit 65ca742
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion DiffSinger_colab_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,28 @@
"#@markdown <font size=\"-1.5\"> path to where you want to save your converted model and it's file\n",
"exp_folder = \"\" #@param{type:\"string\"}\n",
"\n",
"search_text = \" args_work_dir = os.path.join(\"\n",
"replacement = f\" args_work_dir = '{checkpoints_path}'\"\n",
"with open(\"/content/DiffSinger/utils/hparams.py\", \"r\") as file:\n",
" lines = file.readlines()\n",
"for i, line in enumerate(lines):\n",
" if search_text in line:\n",
" lines[i] = replacement + \"\\n\"\n",
" break\n",
"with open(\"/content/DiffSinger/utils/hparams.py\", \"w\") as file:\n",
" file.writelines(lines)\n",
"#incase if anyone wanna change it lmao\n",
"search_text_alt = \" args_work_dir = '\"\n",
"replacement_alt = f\" args_work_dir = '{checkpoints_path}'\"\n",
"with open(\"/content/DiffSinger/utils/hparams.py\", \"r\") as file:\n",
" lines = file.readlines()\n",
"for i, line in enumerate(lines):\n",
" if search_text_alt in line:\n",
" lines[i] = replacement_alt + \"\\n\"\n",
" break\n",
"with open(\"/content/DiffSinger/utils/hparams.py\", \"w\") as file:\n",
" file.writelines(lines)\n",
"\n",
"!cp {checkpoints_path} -r /content/DiffSinger/checkpoints\n",
"if no_warn:\n",
" !python /content/DiffSinger/scripts/export.py {model_type} --exp {folder_name} --out {exp_folder} 2> /dev/null\n",
Expand Down Expand Up @@ -796,4 +818,4 @@
}
}
]
}
}

0 comments on commit 65ca742

Please sign in to comment.