tykiww commited on
Commit
6664e37
1 Parent(s): aeb447f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -19,21 +19,21 @@ conf = get_json_cfg()
19
 
20
  class update_visibility:
21
 
22
- def textbox_visibility(radio):
23
  value = radio
24
  if value == "Hugging Face Hub Dataset":
25
  return gr.Dropdown(visible=bool(1))
26
  else:
27
  return gr.Dropdown(visible=bool(0))
28
 
29
- def textbox_button_visibility(radio):
30
  value = radio
31
  if value == "Hugging Face Hub Dataset":
32
  return gr.Button(visible=bool(1))
33
  else:
34
  return gr.Button(visible=bool(0))
35
 
36
- def upload_visibility(radio):
37
  value = radio
38
  if value == "Upload Your Own":
39
  return gr.UploadButton(visible=bool(1)) #make it visible
@@ -138,13 +138,13 @@ def main():
138
  value=conf['model']['general']["dataset_text_field"])
139
 
140
  data_snippet = gr.Markdown()
141
- dataset_choice.change(update_visibility.textbox_visibility,
142
  dataset_choice,
143
  dataset_predefined)
144
- dataset_choice.change(update_visibility.upload_visibility,
145
  dataset_choice,
146
  dataset_uploaded_load)
147
- dataset_choice.change(update_visibility.textbox_button_visibility,
148
  dataset_choice,
149
  dataset_predefined_load)
150
 
@@ -153,7 +153,7 @@ def main():
153
  inputs=dataset_predefined,
154
  outputs=data_snippet)
155
 
156
- dataset_uploaded_load.click(fn=get_datasets.get_uploaded_dataset,
157
  inputs=dataset_uploaded_load,
158
  outputs=data_snippet)
159
 
 
19
 
20
  class update_visibility:
21
 
22
+ def textbox_vis(radio):
23
  value = radio
24
  if value == "Hugging Face Hub Dataset":
25
  return gr.Dropdown(visible=bool(1))
26
  else:
27
  return gr.Dropdown(visible=bool(0))
28
 
29
+ def textbox_button_vis(radio):
30
  value = radio
31
  if value == "Hugging Face Hub Dataset":
32
  return gr.Button(visible=bool(1))
33
  else:
34
  return gr.Button(visible=bool(0))
35
 
36
+ def upload_vis(radio):
37
  value = radio
38
  if value == "Upload Your Own":
39
  return gr.UploadButton(visible=bool(1)) #make it visible
 
138
  value=conf['model']['general']["dataset_text_field"])
139
 
140
  data_snippet = gr.Markdown()
141
+ dataset_choice.change(update_visibility.textbox_vis,
142
  dataset_choice,
143
  dataset_predefined)
144
+ dataset_choice.change(update_visibility.upload_vis,
145
  dataset_choice,
146
  dataset_uploaded_load)
147
+ dataset_choice.change(update_visibility.textbox_button_vis,
148
  dataset_choice,
149
  dataset_predefined_load)
150
 
 
153
  inputs=dataset_predefined,
154
  outputs=data_snippet)
155
 
156
+ dataset_uploaded_load.click(fn=get_datasets.uploaded_dataset,
157
  inputs=dataset_uploaded_load,
158
  outputs=data_snippet)
159