mirror of
https://github.com/jasonppy/VoiceCraft.git
synced 2026-04-03 01:36:55 +02:00
better hf integration
This commit is contained in:
@@ -203,8 +203,8 @@
|
|||||||
"voicecraft_name=\"giga330M.pth\" # or gigaHalfLibri330M_TTSEnhanced_max16s.pth, giga830M.pth\n",
|
"voicecraft_name=\"giga330M.pth\" # or gigaHalfLibri330M_TTSEnhanced_max16s.pth, giga830M.pth\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# the new way of loading the model, with huggingface, recommended\n",
|
"# the new way of loading the model, with huggingface, recommended\n",
|
||||||
"from models.voicecraft import VoiceCraftHF\n",
|
"from models import voicecraft\n",
|
||||||
"model = VoiceCraftHF.from_pretrained(f\"pyp1/VoiceCraft_{voicecraft_name.replace('.pth', '')}\")\n",
|
"model = voicecraft.VoiceCraft.from_pretrained(f\"pyp1/VoiceCraft_{voicecraft_name.replace('.pth', '')}\")\n",
|
||||||
"phn2num = model.args.phn2num\n",
|
"phn2num = model.args.phn2num\n",
|
||||||
"config = vars(model.args)\n",
|
"config = vars(model.args)\n",
|
||||||
"model.to(device)\n",
|
"model.to(device)\n",
|
||||||
|
|||||||
@@ -74,8 +74,8 @@
|
|||||||
"voicecraft_name=\"giga330M.pth\" # or gigaHalfLibri330M_TTSEnhanced_max16s.pth, giga830M.pth\n",
|
"voicecraft_name=\"giga330M.pth\" # or gigaHalfLibri330M_TTSEnhanced_max16s.pth, giga830M.pth\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# the new way of loading the model, with huggingface, recommended\n",
|
"# the new way of loading the model, with huggingface, recommended\n",
|
||||||
"from models.voicecraft import VoiceCraftHF\n",
|
"from models import voicecraft\n",
|
||||||
"model = VoiceCraftHF.from_pretrained(f\"pyp1/VoiceCraft_{voicecraft_name.replace('.pth', '')}\")\n",
|
"model = voicecraft.VoiceCraft.from_pretrained(f\"pyp1/VoiceCraft_{voicecraft_name.replace('.pth', '')}\")\n",
|
||||||
"phn2num = model.args.phn2num\n",
|
"phn2num = model.args.phn2num\n",
|
||||||
"config = vars(model.args)\n",
|
"config = vars(model.args)\n",
|
||||||
"model.to(device)\n",
|
"model.to(device)\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user