RVC-Boss / GPT-SoVITS

1 min voice data can also be used to train a good TTS model! (few shot voice cloning)
MIT License
33.45k stars 3.84k forks source link

关于 torch_script export 的一些代码问题 #1639

Closed L-jasmine closed 1 week ago

L-jasmine commented 1 week ago

有些代码它影响我导出model成 torch_script 就是 torch.jit.script 这种。但是他们在上下文中并没有被使用,所以我想问问能不能删掉 我正在导出 vits 和 t2s 成 torch_script 然后在 rust 里面推理。目前可以推理出声音,但是我改动了部分python代码。所以我想问问。 我的改动在这里 https://github.com/L-jasmine/GPT-SoVITS/tree/export_torch_script

L-jasmine commented 1 week ago

https://github.com/RVC-Boss/GPT-SoVITS/blob/78c68d46cb969628695d57c4f88b6bceadabb5fe/GPT_SoVITS/module/attentions_onnx.py#L61C9-L73C65 这个 kwargs 在上下文中没有被传递,所以 self.cond_layer_idx 永远是 self.n_layers

https://github.com/RVC-Boss/GPT-SoVITS/blob/78c68d46cb969628695d57c4f88b6bceadabb5fe/GPT_SoVITS/module/attentions_onnx.py#L105-L109 那么这里就永远不会执行 因为 i 最大只能到 self.n_layers-1

所以我可以删掉这部分代码吗?

RVC-Boss commented 1 week ago