Download predict.py from NagaYu/vouch-hubert-lr: direct link, hf CLI and curl.
- Browser
- Download file 674 Bytes
-
https://huggingface.co/NagaYu/vouch-hubert-lr/resolve/main/predict.py
- Command line
-
hf download hf://NagaYu/vouch-hubert-lr/predict.py
-
curl -L -o predict.py https://huggingface.co/NagaYu/vouch-hubert-lr/resolve/main/predict.py
674 Bytes
| """Command-line scoring: python predict.py --audio a.wav [b.ogg ...] [--model-dir .] [--device cpu] | |
| Prints one JSON line per file. score = bona fide likelihood in [0, 1] (uncalibrated).""" | |
| import argparse | |
| import json | |
| from vouch_detector import VouchDetector | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--audio", nargs="+", required=True) | |
| ap.add_argument("--model-dir", default=".") | |
| ap.add_argument("--device", default="cpu") | |
| args = ap.parse_args() | |
| det = VouchDetector(args.model_dir, device=args.device) | |
| for a in args.audio: | |
| print(json.dumps({"audio": a, **det.score_file(a)})) | |
| if __name__ == "__main__": | |
| main() | |