|
Download code/README.md from AustinXiao/VeriSpoof-Base: direct link, hf CLI and curl.
- Browser
- Download file 1.69 kB
-
https://huggingface.co/AustinXiao/VeriSpoof-Base/resolve/main/code/README.md
- Command line
-
hf download hf://AustinXiao/VeriSpoof-Base/code/README.md
-
curl -L -o README.md https://huggingface.co/AustinXiao/VeriSpoof-Base/resolve/main/code/README.md
1.69 kB
| # verispoof | |
| Inference package for VeriSpoof, one audio language model for speech deepfake detection, source verification and | |
| grounded reasoning. Model card: https://huggingface.co/AustinXiao/VeriSpoof-Base | |
| ```python | |
| from verispoof import VeriSpoof | |
| model = VeriSpoof.from_pretrained("AustinXiao/VeriSpoof-Base") # or a local folder | |
| model.detect("sample.wav") # {'label': 'spoof' | 'bonafide', 'score': log p(spoof) - log p(bona fide)} | |
| model.explain("sample.wav") # reasoning lines, decision, spans, per-token probabilities | |
| model.same_source("a.wav", "b.wav") # same generator? (also level="acoustic_model" / "vocoder") | |
| model.compare("a.wav", "b.wav") # source-verification reasoning | |
| model.condition("sample.wav", attr="codec") | |
| model.generator("sample.wav", ["XTTS-v2", "Bark"]) | |
| ``` | |
| Needs a CUDA GPU (about 12 GB) and `transformers` >= 5.13. | |
| Faster reasoning with vLLM (`pip install "./code[vllm]"`), generation only: | |
| ```python | |
| from verispoof.vllm_backend import VeriSpoofVLLM | |
| if __name__ == "__main__": # vLLM starts its engine in a separate process | |
| m = VeriSpoofVLLM.from_pretrained("AustinXiao/VeriSpoof-Base") | |
| m.explain(["a.wav", "b.wav", "c.wav"]) # batched | |
| m.compare([("a.wav", "b.wav")]) | |
| ``` | |
| ## Files | |
| | | | | |
| |---|---| | |
| | `verispoof/encoder.py` | audio encoder | | |
| | `verispoof/audio_tokenizer.py` | audio tokenizer | | |
| | `verispoof/model.py` | encoder → tokenizer → language model, per-token head, prompt layout | | |
| | `verispoof/inference.py` | the `VeriSpoof` API: candidate scoring and greedy reasoning | | |
| | `verispoof/vllm_backend.py` | `VeriSpoofVLLM`: reasoning with vLLM from prompt embeddings | | |