Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ def load_lang(langname):
|
|
44 |
|
45 |
model_word_separator = '|'
|
46 |
model_blank_token = '[PAD]'
|
47 |
-
lang_aligner = ctcalign.
|
48 |
|
49 |
df = df.drop(columns=['audio', 'speaker_id','duration'])
|
50 |
return (df[:10], lang_aligner) #(df, df[:50])
|
@@ -78,7 +78,7 @@ with bl:
|
|
78 |
|
79 |
lloadr = gr.Dropdown(["Faroese", "Icelandic"], label="Select a language",value="Icelandic")#, info="Loading the dataset takes some time")
|
80 |
|
81 |
-
|
82 |
|
83 |
with gr.Row():
|
84 |
#invisidata = gr.DataFrame(interactive=False, visible=False)
|
@@ -91,12 +91,12 @@ with bl:
|
|
91 |
|
92 |
pl1 = gr.Plot()
|
93 |
|
94 |
-
btn1.click(f1, [lloadr,
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
-
lloadr.change(load_lang,lloadr,[databrowser,
|
100 |
|
101 |
|
102 |
gr.Markdown(
|
|
|
44 |
|
45 |
model_word_separator = '|'
|
46 |
model_blank_token = '[PAD]'
|
47 |
+
lang_aligner = ctcalign.aligner(model_path,model_word_separator,model_blank_token)
|
48 |
|
49 |
df = df.drop(columns=['audio', 'speaker_id','duration'])
|
50 |
return (df[:10], lang_aligner) #(df, df[:50])
|
|
|
78 |
|
79 |
lloadr = gr.Dropdown(["Faroese", "Icelandic"], label="Select a language",value="Icelandic")#, info="Loading the dataset takes some time")
|
80 |
|
81 |
+
align_func = gr.State(value=ctcalign.aligner(model_path="carlosdanielhernandezmena/wav2vec2-large-xlsr-53-icelandic-ep10-1000h",model_word_separator = '|',model_blank_token = '[PAD]'))
|
82 |
|
83 |
with gr.Row():
|
84 |
#invisidata = gr.DataFrame(interactive=False, visible=False)
|
|
|
91 |
|
92 |
pl1 = gr.Plot()
|
93 |
|
94 |
+
btn1.click(f1, [lloadr,align_func], pl1)
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
+
lloadr.change(load_lang,lloadr,[databrowser,align_func])
|
100 |
|
101 |
|
102 |
gr.Markdown(
|