Commit Graph
2 Commits
Author SHA1 Message Date
osobhandClaude Opus 4.7 c0ca1e1f8a rtx-csm: Phase 6f.lora + 6f.wm — voice clone + watermark in converse_server
Wires two more capabilities into examples/converse_server.rs:

  --lora <path> [--lora-rank N --lora-alpha A]   inject voice-clone adapter
  --watermark-generator <path>                    \
  --watermark-detector  <path>                     embed AudioSeal on every
  [--watermark-message 0xCAFE]                     assistant utterance

LoRA path: parallels examples/generate.rs — load Generator (FP), build
LoraConfig, add_lora_to_backbone(VarMap), load_lora_adapter, refresh_lora.
Voice clones now work in the conversation pipeline. Combining with
--quantized-gguf is rejected at boot; the LoRA-on-Q8 path works in
generate but the server hasn't been audited so it's gated for now.

Watermark path: parallels examples/generate.rs — load AudioSeal generator
+ detector safetensors via VarBuilder::from_mmaped_safetensors, build
AudioSealWatermarker, wrap in ResampledWatermarker(24k↔16k), install via
generator.set_watermarker(...). converse.rs::synthesize already calls
the watermarker per-utterance, so no plumbing changes needed downstream.

Verified end-to-end:
  * boot server with --watermark-generator/-detector --watermark-message 0xCAFE
  * single conversation turn (10.43s LibriSpeech in -> 4.24s assistant out)
  * detect on response WAV: mean_presence=0.9995, decoded=0xCAFE,
    16/16 message bits matching after full STT->LLM->TTS->post->watermark
    ->24k->WS->wav round-trip.

Also adds audioseal_apply --detect-only flag (skip embed, run detector
against arbitrary WAV) — used to verify the round-trip above. --out is
now optional and only required when not in detect-only mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-27 04:04:27 -07:00
osobhandClaude Opus 4.7 9d28597687 rtx-csm: AudioSeal apply CLI for arbitrary-rate WAVs
End-to-end watermarker driver that handles any source sample rate by
resampling to AudioSeal's 16 kHz native, embedding, then resampling back.
Tested on 10s of real CSM 24 kHz speech: mean_presence=0.9988 detection,
12/16 message bits round-trip (4-bit erosion from double resample).

- examples/audioseal_apply.rs: --in/--out/--source-rate/--message; loads
  source via audio_io::load_mono_at_rate, calls AudioSealWatermarker
  through the public Watermarker trait, verifies via in-process detect.
- Fix bit-match counter overflow in audioseal_demo.rs and audioseal_apply.rs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-25 19:32:14 -07:00