clr commited on
Commit
118d6d2
·
1 Parent(s): 3130108

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -39,21 +39,30 @@ def load_lang(langname):
39
  elif langname =="Faroese":
40
  ds = corpora.ds_f
41
  df = df.drop(columns=['audio', 'speaker_id','duration'])
42
- return df[:25]#(df, df[:50])
43
 
44
 
45
- def f1():
 
 
 
 
 
 
 
46
  fig = plt.figure(figsize=(10,4))
47
  plt.axline((0,0),slope=1,color="darkgray")
48
  plt.xlabel("Vowel length (ms)")
49
  plt.ylabel("Consonant length (ms)")
 
 
50
  return(fig)
51
 
52
  bl = gr.Blocks()
53
 
54
  with bl:
55
 
56
- lloadr = gr.Dropdown(["Faroese", "Icelandic"], label="Select language", info="Loading dataset can take several minutes")
57
 
58
  with gr.Row():
59
  #invisidata = gr.DataFrame(interactive=False, visible=False)
@@ -65,7 +74,7 @@ with bl:
65
 
66
  pl1 = gr.Plot()
67
 
68
- btn1.click(f1, [], pl1)
69
 
70
 
71
  lloadr.change(load_lang,lloadr,[databrowser])
 
39
  elif langname =="Faroese":
40
  ds = corpora.ds_f
41
  df = df.drop(columns=['audio', 'speaker_id','duration'])
42
+ return df[:10]#(df, df[:50])
43
 
44
 
45
+ def f1(langname):
46
+ if langname=="Icelandic":
47
+ ds = corpora.ds_i
48
+ elif langname =="Faroese":
49
+ ds = corpora.ds_f
50
+
51
+ print(ds[40])
52
+
53
  fig = plt.figure(figsize=(10,4))
54
  plt.axline((0,0),slope=1,color="darkgray")
55
  plt.xlabel("Vowel length (ms)")
56
  plt.ylabel("Consonant length (ms)")
57
+
58
+
59
  return(fig)
60
 
61
  bl = gr.Blocks()
62
 
63
  with bl:
64
 
65
+ lloadr = gr.Dropdown(["Faroese", "Icelandic"], label="Select a language", info="Loading the dataset takes some time")
66
 
67
  with gr.Row():
68
  #invisidata = gr.DataFrame(interactive=False, visible=False)
 
74
 
75
  pl1 = gr.Plot()
76
 
77
+ btn1.click(f1, [lloader], pl1)
78
 
79
 
80
  lloadr.change(load_lang,lloadr,[databrowser])