mirror of
https://github.com/guillaumemeyer/watermarks-remover.git
synced 2026-08-22 13:11:57 +02:00
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>
This commit is contained in:
co-authored by
Guillaume Meyer
parent
27c1ce864e
commit
e3eb602128