jennzhuge commited on
Commit
964fd26
·
1 Parent(s): fa1b7c0
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -5,8 +5,6 @@ from transformers import PreTrainedTokenizerFast, BertForMaskedLM
5
  from datasets import load_dataset
6
  import infer
7
 
8
- embeddings_train = load_dataset("LofiAmazon/BOLD-Embeddings-Ecolayers-Amazon", split='train').to_pandas()
9
-
10
  with open("default_inputs.json", "r") as default_inputs_file:
11
  DEFAULT_INPUTS = json.load(default_inputs_file)
12
 
@@ -70,11 +68,13 @@ with gr.Blocks() as demo:
70
  gr.Markdown("Enter a DNA sequence and the coordinates at which its sample was taken to get a genus prediction. Click 'I'm feeling lucky' to see a prediction for a random sequence.")
71
 
72
  # Collect inputs for app (DNA and location)
73
- with gr.Row():
74
  inp_dna = gr.Textbox(label="DNA", placeholder="e.g. AACAATGTA... (min 200 and max 660 characters)")
75
- with gr.Row():
76
- inp_lat = gr.Textbox(label="Latitude", placeholder="e.g. -3.009083")
77
- inp_lng = gr.Textbox(label="Longitude", placeholder="e.g. -58.68281")
 
 
78
 
79
  with gr.Row():
80
  btn_run = gr.Button("Run")
@@ -85,7 +85,7 @@ with gr.Blocks() as demo:
85
  with gr.Row():
86
  gr.Markdown('Make plot or table for Top 5 species')
87
 
88
- with gr.Column():
89
  genus_out = gr.Dataframe(headers=["DNA Only Pred Genus", "DNA Only Prob", "DNA & Env Pred Genus", "DNA & Env Prob"])
90
  btn_run.click(fn=predict_genus, inputs=[inp_dna, inp_lat, inp_lng], outputs=genus_out)
91
 
 
5
  from datasets import load_dataset
6
  import infer
7
 
 
 
8
  with open("default_inputs.json", "r") as default_inputs_file:
9
  DEFAULT_INPUTS = json.load(default_inputs_file)
10
 
 
68
  gr.Markdown("Enter a DNA sequence and the coordinates at which its sample was taken to get a genus prediction. Click 'I'm feeling lucky' to see a prediction for a random sequence.")
69
 
70
  # Collect inputs for app (DNA and location)
71
+ with gr.Column():
72
  inp_dna = gr.Textbox(label="DNA", placeholder="e.g. AACAATGTA... (min 200 and max 660 characters)")
73
+ with gr.Column():
74
+ with gr.Row():
75
+ inp_lat = gr.Textbox(label="Latitude", placeholder="e.g. -3.009083")
76
+ with gr.Row():
77
+ inp_lng = gr.Textbox(label="Longitude", placeholder="e.g. -58.68281")
78
 
79
  with gr.Row():
80
  btn_run = gr.Button("Run")
 
85
  with gr.Row():
86
  gr.Markdown('Make plot or table for Top 5 species')
87
 
88
+ with gr.Row():
89
  genus_out = gr.Dataframe(headers=["DNA Only Pred Genus", "DNA Only Prob", "DNA & Env Pred Genus", "DNA & Env Prob"])
90
  btn_run.click(fn=predict_genus, inputs=[inp_dna, inp_lat, inp_lng], outputs=genus_out)
91