import torch import gradio as gr 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" "
" ) 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=[ ["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/naomi_watts.wav", "samples/cate_blanch_3.mp3"], ["samples/naomi_watts.wav", "samples/denzel_wash.wav"], ["samples/arnold_schwarz.wav", "samples/denzel_wash.wav"], ["samples/arnold_schwarz.wav", "samples/cate_blanch.mp3"], ["samples/arnold_schwarz.wav", "samples/cate_blanch_2.mp3"], ["samples/arnold_schwarz.wav", "samples/heath_ledger_2.mp3"], ["samples/dicaprio_2.wav", "samples/crowe.wav"], ["samples/KirstenDunst.wav", "samples/crowe.wav"], ["samples/cate_blanch_3.mp3", "samples/KirstenDunst.wav"], ["samples/Zendaya.wav", "samples/cate_blanch_3.mp3"], ["samples/dicaprio.wav", "samples/denzel_wash.wav"], ["samples/cate_blanch_2.mp3", "samples/cate_blanch_3.mp3"], ["samples/cate_blanch_2.mp3", "samples/cate_blanch_3.mp3"], ["samples/crowe.wav", "samples/crowe_2.wav"], ["samples/crowe.wav", "samples/crowe_3.wav"], ["samples/dicaprio.wav", "samples/dicaprio_2.wav"], ["samples/heath_ledger.mp3", "samples/heath_ledger_2.mp3"], ["samples/heath_ledger.mp3", "samples/heath_ledger_3.mp3"], ["samples/heath_ledger.mp3", "samples/heath_ledger_4.mp3"], ["samples/heath_ledger_3.mp3", "samples/heath_ledger_2.mp3"], ["samples/heath_ledger_4.mp3", "samples/heath_ledger_2.mp3"], ["samples/heath_ledger_3.mp3", "samples/heath_ledger_4.mp3"], ] ) interface.launch(enable_queue=True)