Spaces:
Running
Running
update mtdna ui
Browse files- mtdna_ui.py +5 -5
mtdna_ui.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
import json
|
4 |
# Gradio UI
|
5 |
with gr.Blocks() as interface:
|
@@ -75,7 +75,7 @@ with gr.Blocks() as interface:
|
|
75 |
|
76 |
# for single accession
|
77 |
def classify_main(accession):
|
78 |
-
table, summary, labelAncient_Modern, explain_label = summarize_results(accession)
|
79 |
flag_output = f"### 🏺 Ancient/Modern Flag\n**{labelAncient_Modern}**\n\n_Explanation:_ {explain_label}"
|
80 |
return (
|
81 |
#table,
|
@@ -87,7 +87,7 @@ with gr.Blocks() as interface:
|
|
87 |
)
|
88 |
# for batch accessions
|
89 |
def classify_mulAcc(file, text):
|
90 |
-
table, summary, flag_output, gr1, gr2 = summarize_batch(file, text)
|
91 |
#flag_output = f"### 🏺 Ancient/Modern Flag\n**{labelAncient_Modern}**\n\n_Explanation:_ {explain_label}"
|
92 |
return (
|
93 |
#table,
|
@@ -164,12 +164,12 @@ with gr.Blocks() as interface:
|
|
164 |
)
|
165 |
|
166 |
download_button.click(
|
167 |
-
fn=save_batch_output,
|
168 |
inputs=[output_table, output_summary, output_flag, output_type],
|
169 |
outputs=[download_file])
|
170 |
|
171 |
submit_feedback.click(
|
172 |
-
fn=store_feedback_to_google_sheets, inputs=[single_accession, q1, q2, contact], outputs=feedback_status
|
173 |
)
|
174 |
# Custom CSS styles
|
175 |
gr.HTML("""
|
|
|
1 |
import gradio as gr
|
2 |
+
import mtdna_backend
|
3 |
import json
|
4 |
# Gradio UI
|
5 |
with gr.Blocks() as interface:
|
|
|
75 |
|
76 |
# for single accession
|
77 |
def classify_main(accession):
|
78 |
+
table, summary, labelAncient_Modern, explain_label = mtdna_backend.summarize_results(accession)
|
79 |
flag_output = f"### 🏺 Ancient/Modern Flag\n**{labelAncient_Modern}**\n\n_Explanation:_ {explain_label}"
|
80 |
return (
|
81 |
#table,
|
|
|
87 |
)
|
88 |
# for batch accessions
|
89 |
def classify_mulAcc(file, text):
|
90 |
+
table, summary, flag_output, gr1, gr2 = mtdna_backend.summarize_batch(file, text)
|
91 |
#flag_output = f"### 🏺 Ancient/Modern Flag\n**{labelAncient_Modern}**\n\n_Explanation:_ {explain_label}"
|
92 |
return (
|
93 |
#table,
|
|
|
164 |
)
|
165 |
|
166 |
download_button.click(
|
167 |
+
fn=mtdna_backend.save_batch_output,
|
168 |
inputs=[output_table, output_summary, output_flag, output_type],
|
169 |
outputs=[download_file])
|
170 |
|
171 |
submit_feedback.click(
|
172 |
+
fn=mtdna_backend.store_feedback_to_google_sheets, inputs=[single_accession, q1, q2, contact], outputs=feedback_status
|
173 |
)
|
174 |
# Custom CSS styles
|
175 |
gr.HTML("""
|