[TTS][SpeakerCacheManager] A global speaker cache manager for Voice Cloning (#2630)
Signed-off-by: JuanPZuluaga <juanz9312@gmal.com> Co-authored-by: JuanPZuluaga <juanz9312@gmal.com>
This commit is contained in:
1 parent
a0918ce583
commit
b64ab05d09
21 files changed
+1353
-1036
No files matched your search
@@ -0,0 +1,21 @@
|
||||
"""Fixtures for the process-wide speaker cache singleton."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fresh_speaker_cache():
|
||||
"""Reset the process-wide speaker cache singleton before and after the test."""
|
||||
import vllm_omni.utils.speaker_cache as _sc
|
||||
|
||||
def _reset():
|
||||
with _sc._SINGLETON_LOCK:
|
||||
if _sc._SINGLETON is not None:
|
||||
_sc._SINGLETON.clear()
|
||||
_sc._SINGLETON = None
|
||||
|
||||
_reset()
|
||||
yield
|
||||
_reset()
|
||||
Reference in new issue
Block a user