Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: release each Qwen3 audition model before loading the next checkpoint (#8857)

[._.]/ Adam Eivye475e3f37806
diff --git a/scripts/qwen3_tts_runner.py b/scripts/qwen3_tts_runner.py
index 1a021150f9..cf1939661b 100755
--- a/scripts/qwen3_tts_runner.py
+++ b/scripts/qwen3_tts_runner.py
@@ -744,6 +744,7 @@ def run_fine_tuning(args: argparse.Namespace) -> int:
published = 0
for item in staged:
sample = item["path"] / "audition.wav"
+ torch = model = None
try:
# Seal first, then pass the same gate and loader synthesis
# uses: only sealed bytes that reload and speak are promotable.
@@ -759,12 +760,16 @@ def run_fine_tuning(args: argparse.Namespace) -> int:
text=AUDITION_TEXT, speaker=manifest["speaker"], language="Auto",
)
write_model_audio(wavs, sample_rate, sample)
- del model
- torch.cuda.empty_cache()
except Exception:
print(f"❌ Checkpoint at step {item['step']} failed its reload audition", file=sys.stderr)
shutil.rmtree(item["path"], ignore_errors=True)
continue
+ finally:
+ # Release each audition model, passed or failed, before the
+ # next checkpoint loads onto the same device.
+ model = None
+ if torch is not None:
+ torch.cuda.empty_cache()
target = output_dir / f"checkpoint-step-{item['step']}"
os.replace(item["path"], target)
published += 1