nolanzandi commited on
Commit
e076df6
·
verified ·
1 Parent(s): 0c573c1

add new healthcare sample file

Browse files
Files changed (2) hide show
  1. data_file.py +7 -4
  2. samples/tb_illness_data.csv +0 -0
data_file.py CHANGED
@@ -12,7 +12,7 @@ def example_display(input):
12
  display = True
13
  else:
14
  display = False
15
- return [gr.update(visible=display),gr.update(visible=display),gr.update(visible=display)]
16
 
17
  with gr.Blocks() as demo:
18
  description = gr.HTML("""
@@ -53,14 +53,17 @@ with gr.Blocks() as demo:
53
  """, elem_classes="description_component")
54
  example_file_1 = gr.File(visible=False, value="samples/bank_marketing_campaign.csv")
55
  example_file_2 = gr.File(visible=False, value="samples/online_retail_data.csv")
 
56
  with gr.Row():
57
- example_btn_1 = gr.Button(value="Try Me: bank_marketing_campaign.csv", elem_classes="example_btn sample-btn bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-6 rounded-lg text-left hover:shadow-lg", size="md", variant="primary")
58
- example_btn_2 = gr.Button(value="Try Me: online_retail_data.csv", elem_classes="example_btn sample-btn bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-6 rounded-lg text-left hover:shadow-lg", size="md", variant="primary")
 
59
 
60
  file_output = gr.File(label="Data File (CSV, TSV, TXT, XLS, XLSX, XML, JSON)", show_label=True, elem_classes="file_marker drop-zone border-2 border-dashed border-gray-300 rounded-lg hover:border-primary cursor-pointer bg-gray-50 hover:bg-blue-50 transition-colors duration-300", file_types=['.csv','.xlsx','.txt','.json','.ndjson','.xml','.xls','.tsv'])
61
  example_btn_1.click(fn=run_example, inputs=example_file_1, outputs=file_output)
62
  example_btn_2.click(fn=run_example, inputs=example_file_2, outputs=file_output)
63
- file_output.change(fn=example_display, inputs=file_output, outputs=[example_btn_1, example_btn_2, description])
 
64
 
65
  @gr.render(inputs=file_output)
66
  def data_options(filename, request: gr.Request):
 
12
  display = True
13
  else:
14
  display = False
15
+ return [gr.update(visible=display),gr.update(visible=display),gr.update(visible=display),gr.update(visible=display)]
16
 
17
  with gr.Blocks() as demo:
18
  description = gr.HTML("""
 
53
  """, elem_classes="description_component")
54
  example_file_1 = gr.File(visible=False, value="samples/bank_marketing_campaign.csv")
55
  example_file_2 = gr.File(visible=False, value="samples/online_retail_data.csv")
56
+ example_file_3 = gr.File(visible=False, value="samples/tb_illness_data.csv")
57
  with gr.Row():
58
+ example_btn_1 = gr.Button(value="Try Me: bank_marketing_campaign.csv", elem_classes="sample-btn bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-6 rounded-lg text-left hover:shadow-lg", size="md", variant="primary")
59
+ example_btn_2 = gr.Button(value="Try Me: online_retail_data.csv", elem_classes="sample-btn bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-6 rounded-lg text-left hover:shadow-lg", size="md", variant="primary")
60
+ example_btn_3 = gr.Button(value="Try Me: tb_illness_data.csv", elem_classes="sample-btn bg-gradient-to-r from-purple-500 to-indigo-600 text-white p-6 rounded-lg text-left hover:shadow-lg", size="md", variant="primary")
61
 
62
  file_output = gr.File(label="Data File (CSV, TSV, TXT, XLS, XLSX, XML, JSON)", show_label=True, elem_classes="file_marker drop-zone border-2 border-dashed border-gray-300 rounded-lg hover:border-primary cursor-pointer bg-gray-50 hover:bg-blue-50 transition-colors duration-300", file_types=['.csv','.xlsx','.txt','.json','.ndjson','.xml','.xls','.tsv'])
63
  example_btn_1.click(fn=run_example, inputs=example_file_1, outputs=file_output)
64
  example_btn_2.click(fn=run_example, inputs=example_file_2, outputs=file_output)
65
+ example_btn_3.click(fn=run_example, inputs=example_file_3, outputs=file_output)
66
+ file_output.change(fn=example_display, inputs=file_output, outputs=[example_btn_1, example_btn_2, example_btn_3, description])
67
 
68
  @gr.render(inputs=file_output)
69
  def data_options(filename, request: gr.Request):
samples/tb_illness_data.csv ADDED
The diff for this file is too large to render. See raw diff