Spaces:
Running
Running
import gradio as gr | |
from sad_tf import * | |
seg = Segmenter(ffmpeg_path="ffmpeg",model_path="keras_speech_music_noise_cnn.hdf5" , device="cpu") | |
def transcribe_audio(audio_file): | |
isig = seg(audio_file) | |
return isig | |
# Define the Gradio interface | |
interface = gr.Interface( | |
fn=transcribe_audio, | |
inputs=gr.Audio(type="filepath"), # Removed 'source="microphone"' | |
outputs="text", | |
title="Audio Transcription", | |
description="Upload an audio file or record audio to get the transcription." | |
) | |
# Launch the Gradio app | |
interface.launch() | |