File size: 710 Bytes
f5c0f72
cdc56f1
f5c0f72
cdc56f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f5c0f72
 
 
 
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
import gradio as gr
from transformers import pipeline

# Load the model separately
model = pipeline("automatic-speech-recognition", model="speechbrain/mtl-mimic-voicebank")

# Define a function to make predictions using the loaded model
def transcribe(audio):
    return model(audio)["text"]

# Define a CSS string to hide the footer
custom_css = """
footer {visibility: hidden;}
"""

# Create the Gradio interface
demo = gr.Interface(
    fn=transcribe,        # Function to process input
    inputs=gr.Audio(source="microphone", type="filepath"),  # Take audio input
    outputs="text",       # Display output as text
    css=custom_css        # Hide the Gradio footer
)

# Launch the interface
demo.launch()