Eachan Johnson commited on
Commit
a891563
·
1 Parent(s): 756d4d1

Fix layouts

Browse files
Files changed (1) hide show
  1. app.py +14 -8
app.py CHANGED
@@ -195,6 +195,11 @@ def predict_file(
195
  input_representation=input_representation,
196
  output_representation=["id", "smiles", "inchikey", "mwt", "clogp"],
197
  )
 
 
 
 
 
198
  species_to_predict = cast(predict, to=list)
199
  prediction_cols = []
200
  for species in species_to_predict:
@@ -347,12 +352,13 @@ with gr.Blocks() as demo:
347
  label="Download predictions",
348
  visible=False,
349
  )
350
- output_line = gr.DataFrame(
351
- label="Predictions",
352
- interactive=False,
353
- visible=False,
354
- )
355
- drawing = gr.Image(label="Chemical structures")
 
356
  gr.on(
357
  [
358
  input_line.submit,
@@ -380,7 +386,7 @@ with gr.Blocks() as demo:
380
  outputs=download_single
381
  )
382
 
383
- with gr.Tab("Convert a file"):
384
  input_file = gr.File(
385
  label="Upload a table of chemical compounds here",
386
  file_types=[".xlsx", ".csv", ".tsv", ".txt"],
@@ -418,7 +424,7 @@ with gr.Blocks() as demo:
418
  )
419
  input_data = gr.Dataframe(
420
  label="Input data",
421
- max_height=100,
422
  visible=False,
423
  interactive=False,
424
  )
 
195
  input_representation=input_representation,
196
  output_representation=["id", "smiles", "inchikey", "mwt", "clogp"],
197
  )
198
+ if prediction_df.shape[0] > 1000:
199
+ message = f"Truncating input to 1000 rows"
200
+ print_err(message)
201
+ gr.Info(message, duration=3)
202
+ prediction_df = prediction_df.iloc[:1000]
203
  species_to_predict = cast(predict, to=list)
204
  prediction_cols = []
205
  for species in species_to_predict:
 
352
  label="Download predictions",
353
  visible=False,
354
  )
355
+ with gr.Row():
356
+ output_line = gr.DataFrame(
357
+ label="Predictions",
358
+ interactive=False,
359
+ visible=False,
360
+ )
361
+ drawing = gr.Image(label="Chemical structures")
362
  gr.on(
363
  [
364
  input_line.submit,
 
386
  outputs=download_single
387
  )
388
 
389
+ with gr.Tab("Convert a file (max. 1000 rows)"):
390
  input_file = gr.File(
391
  label="Upload a table of chemical compounds here",
392
  file_types=[".xlsx", ".csv", ".tsv", ".txt"],
 
424
  )
425
  input_data = gr.Dataframe(
426
  label="Input data",
427
+ max_height=500,
428
  visible=False,
429
  interactive=False,
430
  )