File size: 585 Bytes
2321963
eca3c15
 
 
 
 
f333f65
eca3c15
d173f4d
 
eca3c15
d173f4d
eca3c15
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import gradio as gr
from huggingface_hub import InferenceClient

# Get token from the environment (this will come from Hugging Face Secrets)
HF_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")

# Authenticated client for a private or gated model
client = InferenceClient(
    model="mo-thecreator/Deepfake-audio-detection",
    token=HF_TOKEN
)

def analyze_audio(audio):
    with open(audio, "rb") as f:
        result = client.audio_classification(f)
    return result[0]['label']

interface = gr.Interface(fn=analyze_audio, inputs="audio", outputs="text")
interface.launch()