SWivid / F5-TTS

Official code for "F5-TTS: A Fairytaler that Fakes Fluent and Faithful Speech with Flow Matching"
https://arxiv.org/abs/2410.06885
MIT License
7.48k stars 924 forks source link

cache the custom model fields in the browser for convenience #447

Closed cocktailpeanut closed 2 weeks ago

cocktailpeanut commented 2 weeks ago

The new custom model feature is very powerful but undermined by the fact that you have to type the HF urls every time.

This PR simply caches the field values to the browser localStorage when they change, so when you click "custom", the last used values are already filled out.

SWivid commented 2 weeks ago

@cocktailpeanut , thanks for pr~ Have a modified commit for caching 59761ec9f87c854c8eba79fff186bd1f8df3ec94, cuz using js might have future problem if switch to other gradio component / switch to gradio 5. See if last commit works.

cocktailpeanut commented 2 weeks ago

@cocktailpeanut , thanks for pr~ Have a modified commit for caching 59761ec, cuz using js might have future problem if switch to other gradio component / switch to gradio 5. See if last commit works.

I tested this and i think it's kind of broken. Right now what happens is when you use a custom model, it does get saved to the txt file, but then when you reload and click "custom" again, it triggers this: https://github.com/SWivid/F5-TTS/commit/59761ec9f87c854c8eba79fff186bd1f8df3ec94#diff-c0b08fdea1b5d0d960bc35f91b2b1e45be003a21fb87c7ad4e5f7016bf9cf078R795-R800 which triggers switch_tts_model, at which point the new_choice is Custom, and the custom_ckpt_path and custom_vocab_path are the default SWivid URLs, so just by clicking custom, it resets the custom model we just reset here https://github.com/SWivid/F5-TTS/commit/59761ec9f87c854c8eba79fff186bd1f8df3ec94#diff-c0b08fdea1b5d0d960bc35f91b2b1e45be003a21fb87c7ad4e5f7016bf9cf078R764-R766 so there is no effect.

Maybe I am missing something. If you let me know I can test again.

SWivid commented 2 weeks ago

will test, yes it broke.

update: it's for initialization problem, if simply refresh the webpage, init value will not reload from cache but retain the previous one while starting the gradio service; if restart the service, it's all right then. fixing...

SWivid commented 2 weeks ago

fixed in be53fb179c17c8db16656d017af26578633cd343

cocktailpeanut commented 2 weeks ago

@SWivid just tried, it works! 🫡