fix: unify qwen tts cache dir for tokenizer loading on Windows#218
fix: unify qwen tts cache dir for tokenizer loading on Windows#218seidenbergerscott wants to merge 1 commit intojamiepine:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PyTorchTTSBackend model loading is updated to centralize Hugging Face Hub cache directory handling by importing HF_HUB_CACHE and applying it to model loading calls. Additionally, the torch_dtype parameter is replaced with dtype, specifying float32 for CPU and bfloat16 for GPU paths. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
|
Closing — applied the cache_dir portion of this fix directly to main as part of the 0.4.0 speedrun. Thanks for the diagnosis and fix!
|
Applies the cache_dir portion of #218. On Windows local setups, model assets can split between .hf-cache/hub and .hf-cache/transformers when Qwen3TTSModel.from_pretrained doesn't explicitly pin the cache root — speech_tokenizer and preprocessor_config.json then fail to resolve during load, causing 500s at generation time. Routes both HF Hub and Transformers through hf_constants.HF_HUB_CACHE. Skipped the torch_dtype= → dtype= rename from #218: transformers 4.36 (our minimum) doesn't accept the dtype alias, only 4.46+. Once we bump the minimum we can make that change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
Why
On Windows local setups, model assets can split between .hf-cache/hub and .hf-cache/transformers, causing speech_tokenizer/preprocessor_config.json load errors and 500s during generation.
Summary by CodeRabbit