1 Commits
Author SHA1 Message Date
e3eb602128 fix: never auto-select MPS device for text watermark detection (#99)
resolve_device() auto-selects 'mps' whenever torch reports it available.
Both schemes this harness can load build a device-bound RNG in their
constructor:

  KGW.__init__      -> torch.Generator(device=config.device)   (kgw.py)
  SynthID.__init__  -> torch.Generator(device=config.device)   (synthid.py)

torch.Generator supports only the 'cpu' and 'cuda' device types, so on
Apple Silicon a resolved 'mps' device raises

  RuntimeError: Device type MPS is not supported for torch.Generator() api

and both the `detect` and `watermark` subcommands crash out of the box on
any Mac where torch reports MPS available.

Drop the mps branch from the auto path so `--device auto` resolves to cpu
on CUDA-less machines. `--device mps` is still honored as an explicit
override (resolve_device returns any non-'auto' value unchanged), so this
changes only the automatic default, not the ability to opt in.

Co-authored-by: Guillaume Meyer (The Opinionated Man) <1385518+guillaumemeyer@users.noreply.github.com>
2026-08-16 18:19:59 -07:00