chrissoria commited on
Commit
2c8da2b
·
1 Parent(s): 30c88db

Auto-populate columns on file upload, remove redundant button

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -276,13 +276,11 @@ https://github.com/chrissoria/cat-llm
276
  file_types=[".csv", ".xlsx", ".xls"]
277
  )
278
 
279
- with gr.Row():
280
- spreadsheet_column = gr.Dropdown(
281
- label="Column to Classify",
282
- choices=[],
283
- info="Select the column containing text to classify"
284
- )
285
- load_cols_btn = gr.Button("Upload File", size="sm")
286
 
287
  gr.Markdown("### Categories")
288
  category_inputs = []
@@ -365,7 +363,7 @@ https://github.com/chrissoria/cat-llm
365
  outputs=[model, api_key, api_key_status]
366
  )
367
 
368
- load_cols_btn.click(
369
  fn=load_columns,
370
  inputs=[spreadsheet_file],
371
  outputs=[spreadsheet_column, status]
 
276
  file_types=[".csv", ".xlsx", ".xls"]
277
  )
278
 
279
+ spreadsheet_column = gr.Dropdown(
280
+ label="Column to Classify",
281
+ choices=[],
282
+ info="Select the column containing text to classify"
283
+ )
 
 
284
 
285
  gr.Markdown("### Categories")
286
  category_inputs = []
 
363
  outputs=[model, api_key, api_key_status]
364
  )
365
 
366
+ spreadsheet_file.change(
367
  fn=load_columns,
368
  inputs=[spreadsheet_file],
369
  outputs=[spreadsheet_column, status]