mirror of
https://github.com/denizsafak/abogen.git
synced 2026-09-20 19:50:59 +02:00
refactor(shutdown): move shutdown logic in one place
This commit is contained in:
@@ -144,3 +144,11 @@ def _ensure_single_voice_asset(
|
||||
|
||||
hf_hub_download(resume_download=True, **common_kwargs)
|
||||
return True
|
||||
|
||||
|
||||
def clear_voice_cache() -> None:
|
||||
"""Clear the in‑process voice cache (used during shutdown)."""
|
||||
with _CACHE_LOCK:
|
||||
_CACHED_VOICES.clear()
|
||||
global _BOOTSTRAPPED
|
||||
_BOOTSTRAPPED = False
|
||||
|
||||
Reference in New Issue
Block a user