Spaces:
Sleeping
Sleeping
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() | |