jvalero commited on
Commit
1b1e8e6
1 Parent(s): 36cb8ee

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -0
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import pipeline
2
+
3
+ model_id = "wav2vec2-base-vinyl_condition"
4
+
5
+
6
+ def get_vinyl_condition(filepath):
7
+ output = pipe(
8
+ filepath,
9
+ max_new_tokens=256,
10
+ chunk_length_s=30,
11
+ batch_size=8,
12
+ )
13
+ return [0]["label"]
14
+
15
+ import gradio as gr
16
+
17
+ demo = gr.Blocks()
18
+
19
+
20
+ file_transcribe = gr.Interface(
21
+ fn=get_vinyl_condition,
22
+ inputs=gr.Audio(sources="upload", type="filepath"),
23
+ outputs=gr.outputs.Textbox(),
24
+ )
25
+