DakeQQ / F5-TTS-ONNX

Running the F5-TTS by ONNX Runtime
42 stars 4 forks source link

for loop while f5transformer running #3

Closed Chen233-Y closed 2 weeks ago

Chen233-Y commented 3 weeks ago

Hi there, I noticed while running F5transformer, the loop time is nfe_step, with t = torch.linspace(0, 1, self.steps + 1,dtype=torch.float32). As the same part in source code of F5-TTS, they use an ODE solver, only calculates (nfe_step -1) times, with t = torch.linspace(t_start, 1, steps, device=self.device, dtype=step_cond.dtype). puzzlld with these differences.

I also made another modification to the onnx export. The FOR loop time I used is (NFE_Step-1). I understand that this may not have a significant impact as the generated audio can be listened well. But I want to know if I have any misunderstandings.

Appreciation with any reply.

主要对这里for循环的次数有一些疑惑的地方,因为我理解这部分应该是在计算积分(大概?),即使在linspace中steps+1也只是把整个积分区域多切分一次,最终的值应该没有很大的变化,但我还是对这样处理的原因感到好奇。 感谢!

DakeQQ commented 3 weeks ago

The Euler solution for the source code relies on differential iteration, so the number of iterations should be NFE_STEP-1. However, I personally understand NFE_STEP to refer to the number of iterations, which means it should run exactly as specified. Therefore, I made my own adjustments.

源码中的Euler解法是依靠差分迭代的,因此迭代次数应该是NFE_STEP-1。然而,我个人理解NFE_STEP指的是迭代次数,也就是说应该写多少就跑多少。所以我自己进行了修改。