agentforeverything's picture
Update app.py
38d6c01 verified
raw
history blame contribute delete
639 Bytes
import gradio as gr
from transformers import pipeline
# Load audio classification pipeline with an open model
model = pipeline("audio-classification", model="motheecreator/Deepfake-audio-detection")
def detect_deepfake(audio):
result = model(audio)[0]
label = result['label']
score = result['score']
return f"{label} ({round(score * 100, 2)}%)"
gr.Interface(
fn=detect_deepfake,
inputs=gr.Audio(type="filepath", label="Upload a voice clip"),
outputs="text",
title="AI Voice Detector",
description="This tool uses a trained AI model to detect whether a voice clip is real or AI-generated."
).launch()