Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
import subprocess,os
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
# https://github.com/catir/aligned-reaper/
|
7 |
-
#
|
8 |
|
9 |
|
10 |
import matplotlib
|
11 |
matplotlib.use('Agg')
|
12 |
import matplotlib.pyplot as plt
|
13 |
-
import subprocess
|
14 |
|
15 |
|
16 |
def setup():
|
@@ -34,11 +29,17 @@ def setup():
|
|
34 |
print('LS::', r9.stdout)
|
35 |
|
36 |
|
37 |
-
print('about to setup')
|
38 |
-
setup()
|
39 |
-
|
40 |
-
|
41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
|
44 |
def f1():
|
@@ -49,6 +50,7 @@ def f1():
|
|
49 |
return(fig)
|
50 |
|
51 |
bl = gr.Blocks()
|
|
|
52 |
with bl:
|
53 |
btn1 = gr.Button(value="The random prosody button")
|
54 |
btn1.style(full_width=False, size="sm")
|
@@ -57,6 +59,13 @@ with bl:
|
|
57 |
|
58 |
btn1.click(f1, [], pl1)
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
bl.launch()
|
|
|
1 |
import gradio as gr
|
2 |
import subprocess,os
|
3 |
+
from datasets import load_dataset, Audio
|
|
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
import matplotlib
|
7 |
matplotlib.use('Agg')
|
8 |
import matplotlib.pyplot as plt
|
|
|
9 |
|
10 |
|
11 |
def setup():
|
|
|
29 |
print('LS::', r9.stdout)
|
30 |
|
31 |
|
32 |
+
#print('about to setup')
|
33 |
+
#setup()
|
|
|
|
|
34 |
|
35 |
+
def load_lang(langname):
|
36 |
+
if langname=="Icelandic":
|
37 |
+
dsname = "language-and-voice-lab/samromur_asr"
|
38 |
+
ds = load_dataset(dsname,split='validation')#, streaming=True)
|
39 |
+
ds = ds.cast_column("audio", Audio(sampling_rate=16_000))
|
40 |
+
df = ds.data.to_pandas()
|
41 |
+
df = df.drop(columns=['audio', 'speaker_id','duration'])
|
42 |
+
return df
|
43 |
|
44 |
|
45 |
def f1():
|
|
|
50 |
return(fig)
|
51 |
|
52 |
bl = gr.Blocks()
|
53 |
+
|
54 |
with bl:
|
55 |
btn1 = gr.Button(value="The random prosody button")
|
56 |
btn1.style(full_width=False, size="sm")
|
|
|
59 |
|
60 |
btn1.click(f1, [], pl1)
|
61 |
|
62 |
+
lloadr = gr.Dropdown(["Faroese", "Icelandic"], label="Language", info="Load data for selection...")
|
63 |
+
|
64 |
+
with gr.Row():
|
65 |
+
databrowser = gr.DataFrame(wrap=True, max_rows=50, interactive=False, overflow_row_behaviour='paginate')
|
66 |
+
|
67 |
+
lloadr.change(load_lang,lloadr,databrowser)
|
68 |
+
|
69 |
|
70 |
if __name__ == "__main__":
|
71 |
bl.launch()
|