File size: 420 Bytes
d0ef145
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from transformers import pipeline
import gradio as gr

model = pipeline(model="gymeee/demo_code_switching")


def transcribe_audio(mic):
    
    audio = mic
    transcription = model(audio)["text"]
    return transcription


gr.Interface(
    fn=transcribe_audio,
    inputs=[
        gr.Audio(source="microphone", type="filepath", optional=True),
        
    ],
    outputs="text",
    share=True
).launch(share=True)