Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Alykasym
Copy link

@Alykasym Alykasym commented Oct 15, 2025

A GPU inference bug caused words to be skipped at the start or end of sentences. The root cause was an ASR model that was always loaded to GPU (and left resident) even when a user supplied reference text, creating GPU memory pressure and interfering with subsequent model loads.

Fix: only load the ASR model when no reference text is provided, and explicitly unload it (torch.cuda.empty_cache() / gc.collect()) immediately after transcription so the main model can load to GPU cleanly - the skipping no longer occurs in tests.

@SWivid
Copy link
Owner

SWivid commented Oct 15, 2025

Hi @Alykasym

The root cause was an ASR model that was always loaded to GPU (and left resident) even when a user supplied reference text

ASR model will not be loaded if ref_text provided.

Consider using a GPU card with >=4gb memory if you need ASR and TTS loaded together, otherwise the current PR's hardcoded modification will enforce reloading ASR model every time thus large overhead when inference.

@Alykasym
Copy link
Author

Hi @SWivid , Thank you for quick response. I've tested on 8GB, 24GB and 48GB VRAM GPU. For some reason I was constantly getting skipped words especially in small sentences. But after explicitly adding unload ASR model, it never skipped a word.

the current PR's hardcoded modification will enforce reloading ASR model every time thus large overhead when inference.

I understand that, but keeping the ASR in memory leads to skipping words. Though no idea why exactly it happens.

@Alykasym
Copy link
Author

And it doesn't skip words when I move ASR to CPU. As long as ASR not in the same memory with the F5 model, it doesn't skip words.

@SWivid
Copy link
Owner

SWivid commented Oct 15, 2025

@Alykasym maybe it is better to provide us some reproducible buggy examples, i.e.:
the ref_text ref_audio gen_text and the used random_seed, while the output gen_audio is facing/not facing word skipping.

@SWivid
Copy link
Owner

SWivid commented Oct 22, 2025

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants