import gradio as gr import torch from torchaudio.sox_effects import apply_effects_file from transformers import AutoFeatureExtractor, AutoModelForAudioXVector device = torch.device("cuda" if torch.cuda.is_available() else "cpu") STYLE = """ """ OUTPUT_OK = ( STYLE + """
" "🎙️ Learn more about UniSpeech-SAT | " "📚 UniSpeech-SAT paper | " "📚 X-Vector paper" "
" ) examples = [ ["samples/cate_blanch.mp3", "samples/cate_blanch_2.mp3"], ["samples/cate_blanch.mp3", "samples/cate_blanch_3.mp3"], ["samples/cate_blanch_2.mp3", "samples/cate_blanch_3.mp3"], ["samples/heath_ledger.mp3", "samples/heath_ledger_2.mp3"], ["samples/heath_ledger.mp3", "samples/heath_ledger_3.mp3"], ["samples/heath_ledger_2.mp3", "samples/heath_ledger_3.mp3"], ["samples/russel_crowe.mp3", "samples/russel_crowe_2.mp3"], ["samples/cate_blanch.mp3", "samples/kirsten_dunst.wav"], ["samples/russel_crowe.mp3", "samples/kirsten_dunst.wav"], ["samples/russel_crowe_2.mp3", "samples/kirsten_dunst.wav"], ["samples/leonardo_dicaprio.mp3", "samples/denzel_washington.mp3"], ["samples/heath_ledger.mp3", "samples/denzel_washington.mp3"], ["samples/heath_ledger_2.mp3", "samples/denzel_washington.mp3"], ["samples/leonardo_dicaprio.mp3", "samples/russel_crowe.mp3"], ["samples/leonardo_dicaprio.mp3", "samples/russel_crowe_2.mp3"], ["samples/naomi_watts.mp3", "samples/denzel_washington.mp3"], ["samples/naomi_watts.mp3", "samples/leonardo_dicaprio.mp3"], ["samples/naomi_watts.mp3", "samples/cate_blanch_2.mp3"], ["samples/naomi_watts.mp3", "samples/kirsten_dunst.wav"], ] interface = gr.Interface( fn=similarity_fn, inputs=inputs, outputs=output, title="Voice Authentication with UniSpeech-SAT + X-Vectors", description=description, article=article, layout="horizontal", theme="huggingface", allow_flagging=False, live=False, examples=examples, ) interface.launch(enable_queue=True)