Run this model with HF Jobs

Run wsntxxn/HoliAntiSpoof on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/wsntxxn/HoliAntiSpoof. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/wsntxxn/HoliAntiSpoof on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/wsntxxn/HoliAntiSpoof. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/wsntxxn/HoliAntiSpoof. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

How to Get Started with the Model

Use the code below to get started with the model.

import re
import torch
from transformers import Qwen2_5OmniProcessor, Qwen2_5OmniThinkerForConditionalGeneration
from peft import PeftModel
from qwen_omni_utils import process_mm_info

model = Qwen2_5OmniThinkerForConditionalGeneration.from_pretrained(
    "Qwen/Qwen2.5-Omni-7B",
    torch_dtype="auto",
    device_map="auto",
    attn_implementation="flash_attention_2"
)
model = PeftModel.from_pretrained(model, "wsntxxn/HoliAntiSpoof")
model = model.merge_and_unload()

conversation = [
    {
        'role': 'system',
        'content': [
            {
                'type': 'text',
                'text': 'You are Qwen, a virtual human developed by the Qwen Team, Alibaba Group, capable of perceiving auditory and visual inputs, as well as generating text and speech.'
            }
        ]
    },
    {
        'role': 'user',
        'content': [
            {
                'type': 'audio',
                'audio': '/path/to/audio'
            },
            {
                'type': 'text',
                'text': 'Determine whether this audio clip is a spoof or not. If it is a spoof, determine the spoofing method and the spoofing region.'  # without semantic analysis
                # 'text': 'Is this speech utterance a spoof or not? If it is, please provide the spoofing method, the spoofing time region, and the potential influence of the spoofing text content on the semantic meaning of the utterance.'  # with semantic analysis
            }
        ]
    }
]

processor = Qwen2_5OmniProcessor.from_pretrained("Qwen/Qwen2.5-Omni-7B")
tokenizer = processor.tokenizer
real_fake_seq_idx = 6
real_token_vocab_idx = tokenizer.convert_tokens_to_ids("real")
fake_token_vocab_idx = tokenizer.convert_tokens_to_ids("fake")
pattern = re.compile("<|im_end|>|<|endoftext|>")

text = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
audios, _, _ = process_mm_info(conversation, use_audio_in_video=False)
inputs = processor(
    text=text, audio=audios, images=None, videos=None, return_tensors="pt", padding=True, use_audio_in_video=False
)
inputs = inputs.to(model.device).to(model.dtype)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=1024,
        tokenizer=tokenizer,
        stop_strings=["<|im_end|>", "<|endoftext|>"],
        output_scores=True,
        return_dict_in_generate=True
    )

output_trimmed = outputs.sequences[0, len(inputs["input_ids"][0]):]
output_text = tokenizer.decode(
    output_trimmed, skip_special_tokens=False, clean_up_tokenization_spaces=False
)
matched = pattern.search(output_text)
if matched:
    output_text = output_text[:matched.start()]
real_logit = outputs.scores[real_fake_seq_idx][0, real_token_vocab_idx].item()
fake_logit = outputs.scores[real_fake_seq_idx][0, fake_token_vocab_idx].item()

print(f"output: {output_text}, real logit: {real_logit:.3f}, fake logit: {fake_logit:.3f}")

Citation

BibTeX:

@article{xu2026holiantispoof,
  title={HoliAntiSpoof: Audio LLM for Holistic Speech Anti-Spoofing},
  author={Xu, Xuenan and Ren, Yiming and Liu, Liwei and Wu, Wen and Li, Baoxiang and Lu, Chaochao and Wang, Shuai and Zhang, Chao},
  journal={arXiv preprint arXiv:2602.04535},
  year={2026}
}

Framework versions

  • PEFT 0.17.1
Downloads last month
110
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for wsntxxn/HoliAntiSpoof

Adapter
(67)
this model

Space using wsntxxn/HoliAntiSpoof 1

Paper for wsntxxn/HoliAntiSpoof