File size: 701 Bytes
1b1e8e6
02500bf
 
 
 
 
1b1e8e6
 
 
 
 
 
 
 
 
 
 
17734e0
1b1e8e6
 
 
 
 
 
 
 
 
 
 
 
46d22b1
 
 
 
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
from transformers import pipeline
import torch
from transformers import pipeline
from transformers.pipelines.audio_utils import ffmpeg_read
import gradio as gr


model_id = "wav2vec2-base-vinyl_condition"  


def get_vinyl_condition(filepath):
    output = pipe(
        filepath,
        max_new_tokens=256,
        chunk_length_s=30,
        batch_size=8,
    )
    return output[0]["label"]

import gradio as gr

demo = gr.Blocks()


file_transcribe = gr.Interface(
    fn=get_vinyl_condition,
    inputs=gr.Audio(sources="upload", type="filepath"),
    outputs=gr.outputs.Textbox(),
)

with demo:
    gr.TabbedInterface([file_transcribe], ["Transcribe Audio File"])

demo.launch(enable_queue=True)