File size: 740 Bytes
ea16f84
 
 
49520fc
 
ea16f84
49520fc
 
 
 
 
 
 
 
 
 
 
 
 
 
ea16f84
f0fa166
ea16f84
 
49520fc
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
# Code adapted from: https://gradio.app/demos/

import gradio as gr
from transformers import pipeline
import numpy as np

transcriber = pipeline("automatic-speech-recognition", model="bartelds/gos-gpu6-cp1_adp0_192m_no_test_1e-5_cp-12000")

def transcribe(audio):
    sr, y = audio
    y = y.astype(np.float32)
    y /= np.max(np.abs(y))

    return transcriber({"sampling_rate": sr, "raw": y})["text"]


demo = gr.Interface(
    transcribe,
    gr.Audio(source="upload"),
    "text",
    title="Speech-to-text for Gronings",
    description="Upload an audio file (in 16 kHz) with Gronings speech to obtain its transcription. Example files are in our [gos-demo](https://huggingface.co/datasets/bartelds/gos-demo) dataset."
)

demo.launch()