Spaces:
Runtime error
Runtime error
File size: 1,220 Bytes
a67745e 1ed5802 8baf099 1ed5802 b400508 1ed5802 8baf099 1ed5802 8baf099 1ed5802 317c337 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
"""
Gradio app setup and launch module
Author: Jakub Polnis
Copyright: Copyright 2025, Jakub Polnis
License: Apache 2.0
Email: [email protected]
"""
import gradio as gr
from predict import prediction
from transformers import AutoImageProcessor, AutoModelForImageClassification
from functools import partial
title = "Audio deepfake Classification"
description = """This space uses fine-tuned kubinooo/convnext-tiny-224-audio-deepfake-classification model to classify audio files.
"""
processor = AutoImageProcessor.from_pretrained("kubinooo/convnext-tiny-224-audio-deepfake-classification")
model = AutoModelForImageClassification.from_pretrained("kubinooo/convnext-tiny-224-audio-deepfake-classification")
demo = gr.Interface(
title=title,
inputs=gr.Audio( type="filepath",
interactive=True, # This prevents users from uploading their own images
show_label=True,
label="Select from examples below or upload/record your own audio"),
fn=partial(prediction, processor=processor, model=model),
outputs=gr.Label(
num_top_classes=2,
),
examples=[
"src/31-MALE-VC-FAKE.wav",
"src/2152-REAL.wav"
],
description=description
)
demo.launch() |