Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.

Commit 65ca742

Browse files
committed
update onnx export so users doesnt have to run extract data prior to it
1 parent 5d8ce4b commit 65ca742

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

DiffSinger_colab_notebook.ipynb

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,28 @@
698698
"#@markdown <font size=\"-1.5\"> path to where you want to save your converted model and it's file\n",
699699
"exp_folder = \"\" #@param{type:\"string\"}\n",
700700
"\n",
701+
"search_text = \" args_work_dir = os.path.join(\"\n",
702+
"replacement = f\" args_work_dir = '{checkpoints_path}'\"\n",
703+
"with open(\"/content/DiffSinger/utils/hparams.py\", \"r\") as file:\n",
704+
" lines = file.readlines()\n",
705+
"for i, line in enumerate(lines):\n",
706+
" if search_text in line:\n",
707+
" lines[i] = replacement + \"\\n\"\n",
708+
" break\n",
709+
"with open(\"/content/DiffSinger/utils/hparams.py\", \"w\") as file:\n",
710+
" file.writelines(lines)\n",
711+
"#incase if anyone wanna change it lmao\n",
712+
"search_text_alt = \" args_work_dir = '\"\n",
713+
"replacement_alt = f\" args_work_dir = '{checkpoints_path}'\"\n",
714+
"with open(\"/content/DiffSinger/utils/hparams.py\", \"r\") as file:\n",
715+
" lines = file.readlines()\n",
716+
"for i, line in enumerate(lines):\n",
717+
" if search_text_alt in line:\n",
718+
" lines[i] = replacement_alt + \"\\n\"\n",
719+
" break\n",
720+
"with open(\"/content/DiffSinger/utils/hparams.py\", \"w\") as file:\n",
721+
" file.writelines(lines)\n",
722+
"\n",
701723
"!cp {checkpoints_path} -r /content/DiffSinger/checkpoints\n",
702724
"if no_warn:\n",
703725
" !python /content/DiffSinger/scripts/export.py {model_type} --exp {folder_name} --out {exp_folder} 2> /dev/null\n",
@@ -796,4 +818,4 @@
796818
}
797819
}
798820
]
799-
}
821+
}

0 commit comments

Comments
 (0)