Audio Classification
Transformers
Safetensors
multilingual
wav2vec2-dual-hypersphere
audio-deepfake
deepfake-detection
deepfake
voice-cloning
anti-spoofing
asvspoof
wav2vec2
speech
audio
synthetic-voice
voice-conversion
tts-detection
trust-and-safety
security
SoTA
Modotte
custom_code
Instructions to use Modotte/AIRealNet-Audio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Modotte/AIRealNet-Audio with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="Modotte/AIRealNet-Audio", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForAudioClassification model = AutoModelForAudioClassification.from_pretrained("Modotte/AIRealNet-Audio", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 938 Bytes
09dcb2a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | from transformers import Wav2Vec2Config
class Wav2Vec2DualHypersphereConfig(Wav2Vec2Config):
model_type = "wav2vec2-dual-hypersphere"
def __init__(
self,
classifier_proj_size=256,
final_dropout=0.1,
freeze_feat_extract_train=True,
**kwargs,
):
# Ensure default classification metadata is set before calling super
if "num_labels" not in kwargs:
kwargs["num_labels"] = 2
if "id2label" not in kwargs:
kwargs["id2label"] = {0: "AI Voice (Fake)", 1: "Human Voice (Real)"}
if "label2id" not in kwargs:
kwargs["label2id"] = {"AI Voice (Fake)": 0, "Human Voice (Real)": 1}
super().__init__(**kwargs)
self.classifier_proj_size = classifier_proj_size
self.final_dropout = final_dropout
self.freeze_feat_extract_train = freeze_feat_extract_train
__all__ = ["Wav2Vec2DualHypersphereConfig"] |