Spaces:
Paused
Paused
Commit ·
5a98019
1
Parent(s): 08f3c66
fix: voice cloning OOM on T4 - load 1.7B Base model on CPU
Browse filesGPU VRAM is fully occupied by TTS 0.6B + Whisper + Q&A 3B.
Voice cloning (one-time operation) now runs on CPU to avoid OOM.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- voice_clone.py +6 -5
voice_clone.py
CHANGED
|
@@ -109,22 +109,23 @@ def _select_attn_impl() -> str:
|
|
| 109 |
|
| 110 |
|
| 111 |
def get_qwen_tts():
|
| 112 |
-
"""Lazy-load Qwen3-TTS model.
|
| 113 |
global _qwen_tts_model
|
| 114 |
if _qwen_tts_model is None:
|
| 115 |
with _model_lock:
|
| 116 |
if _qwen_tts_model is None:
|
| 117 |
from qwen_tts import Qwen3TTSModel
|
| 118 |
|
| 119 |
-
model_id =
|
| 120 |
-
|
|
|
|
| 121 |
|
| 122 |
-
logger.info("Loading %s on %s...", model_id, device)
|
| 123 |
_qwen_tts_model = Qwen3TTSModel.from_pretrained(
|
| 124 |
model_id,
|
| 125 |
device_map=device,
|
| 126 |
)
|
| 127 |
-
logger.info("Qwen3-TTS loaded
|
| 128 |
return _qwen_tts_model
|
| 129 |
|
| 130 |
|
|
|
|
| 109 |
|
| 110 |
|
| 111 |
def get_qwen_tts():
|
| 112 |
+
"""Lazy-load Qwen3-TTS Base 1.7B model for cloning. Uses CPU to avoid OOM."""
|
| 113 |
global _qwen_tts_model
|
| 114 |
if _qwen_tts_model is None:
|
| 115 |
with _model_lock:
|
| 116 |
if _qwen_tts_model is None:
|
| 117 |
from qwen_tts import Qwen3TTSModel
|
| 118 |
|
| 119 |
+
model_id = BASE_MODEL_ID
|
| 120 |
+
# Always use CPU for the 1.7B cloning model — GPU is occupied by TTS/ASR/Q&A
|
| 121 |
+
device = "cpu"
|
| 122 |
|
| 123 |
+
logger.info("Loading %s on %s (cloning model)...", model_id, device)
|
| 124 |
_qwen_tts_model = Qwen3TTSModel.from_pretrained(
|
| 125 |
model_id,
|
| 126 |
device_map=device,
|
| 127 |
)
|
| 128 |
+
logger.info("Qwen3-TTS Base loaded on CPU.")
|
| 129 |
return _qwen_tts_model
|
| 130 |
|
| 131 |
|