Spaces:
Sleeping
Sleeping
chore: update design in version 6
Browse files
app.py
CHANGED
@@ -470,7 +470,6 @@ def reset_fn():
|
|
470 |
submit_button: gr.update(value="Confirm Symptoms"),
|
471 |
user_id_box: gr.update(visible=False, value=None, interactive=False),
|
472 |
user_vect_box1: None,
|
473 |
-
recap_symptoms_box: gr.update(visible=False, value=None),
|
474 |
default_symptoms: gr.update(visible=True, value=None),
|
475 |
disease_box: gr.update(visible=True, value=None),
|
476 |
quant_vect_box: gr.update(visible=False, value=None, interactive=False),
|
@@ -581,9 +580,7 @@ if __name__ == "__main__":
|
|
581 |
error_box1 = gr.Textbox(label="Error β", visible=False)
|
582 |
|
583 |
# Default disease, picked from the dataframe
|
584 |
-
gr.Markdown(
|
585 |
-
"You can choose an **existing disease** and explore its associated symptoms."
|
586 |
-
)
|
587 |
|
588 |
with gr.Row():
|
589 |
with gr.Column(scale=2):
|
@@ -683,11 +680,11 @@ if __name__ == "__main__":
|
|
683 |
)
|
684 |
|
685 |
with gr.TabItem("3. FHE execution", id=2):
|
|
|
686 |
gr.Markdown("<span style='color:grey'>Server Side</span>")
|
687 |
-
gr.Markdown("## Run the FHE evaluation")
|
688 |
gr.Markdown(
|
689 |
"Once the server receives the encrypted data, it can process and compute the output without ever decrypting the data just as it would on clear data.\n\n"
|
690 |
-
"This server employs a logistic regression model that has been trained on this [data-set](https://github.com/anujdutt9/Disease-Prediction-from-Symptoms/tree/master/dataset)."
|
691 |
)
|
692 |
|
693 |
run_fhe_btn = gr.Button("Run the FHE evaluation π")
|
@@ -703,8 +700,10 @@ if __name__ == "__main__":
|
|
703 |
)
|
704 |
|
705 |
with gr.TabItem("4. Data Decryption", id=3):
|
|
|
706 |
gr.Markdown("<span style='color:grey'>Client Side</span>")
|
707 |
-
|
|
|
708 |
|
709 |
error_box6 = gr.Textbox(label="Error β", visible=False)
|
710 |
|
@@ -722,11 +721,7 @@ if __name__ == "__main__":
|
|
722 |
outputs=[srv_resp_retrieve_data_box, error_box6],
|
723 |
)
|
724 |
|
725 |
-
gr.Markdown("
|
726 |
-
|
727 |
-
recap_symptoms_box = gr.Textbox(
|
728 |
-
label="Summary of chief complaints:", visible=False, max_lines=3
|
729 |
-
)
|
730 |
|
731 |
decrypt_target_btn = gr.Button(
|
732 |
"Decrypt the output with the π private secret decryption key π"
|
@@ -739,6 +734,11 @@ if __name__ == "__main__":
|
|
739 |
inputs=[user_id_box, user_vect_box1, *check_boxes],
|
740 |
outputs=[decrypt_target_box, error_box7],
|
741 |
)
|
|
|
|
|
|
|
|
|
|
|
742 |
|
743 |
gen_key_btn.click(
|
744 |
key_gen_fn,
|
@@ -773,7 +773,6 @@ if __name__ == "__main__":
|
|
773 |
error_box7,
|
774 |
disease_box,
|
775 |
default_symptoms,
|
776 |
-
recap_symptoms_box,
|
777 |
user_id_box,
|
778 |
key_len_box,
|
779 |
key_box,
|
|
|
470 |
submit_button: gr.update(value="Confirm Symptoms"),
|
471 |
user_id_box: gr.update(visible=False, value=None, interactive=False),
|
472 |
user_vect_box1: None,
|
|
|
473 |
default_symptoms: gr.update(visible=True, value=None),
|
474 |
disease_box: gr.update(visible=True, value=None),
|
475 |
quant_vect_box: gr.update(visible=False, value=None, interactive=False),
|
|
|
580 |
error_box1 = gr.Textbox(label="Error β", visible=False)
|
581 |
|
582 |
# Default disease, picked from the dataframe
|
583 |
+
gr.Markdown("You can choose an **existing disease** and explore its associated symptoms.")
|
|
|
|
|
584 |
|
585 |
with gr.Row():
|
586 |
with gr.Column(scale=2):
|
|
|
680 |
)
|
681 |
|
682 |
with gr.TabItem("3. FHE execution", id=2):
|
683 |
+
gr.Markdown("## Step 3: Run the FHE evaluation")
|
684 |
gr.Markdown("<span style='color:grey'>Server Side</span>")
|
|
|
685 |
gr.Markdown(
|
686 |
"Once the server receives the encrypted data, it can process and compute the output without ever decrypting the data just as it would on clear data.\n\n"
|
687 |
+
"This server employs a [logistic regression]() model that has been trained on this [data-set](https://github.com/anujdutt9/Disease-Prediction-from-Symptoms/tree/master/dataset)."
|
688 |
)
|
689 |
|
690 |
run_fhe_btn = gr.Button("Run the FHE evaluation π")
|
|
|
700 |
)
|
701 |
|
702 |
with gr.TabItem("4. Data Decryption", id=3):
|
703 |
+
gr.Markdown("## Step 4: Decrypt the data")
|
704 |
gr.Markdown("<span style='color:grey'>Client Side</span>")
|
705 |
+
|
706 |
+
gr.Markdown("### Get the data from the <span style='color:grey'>Server Side</span>")
|
707 |
|
708 |
error_box6 = gr.Textbox(label="Error β", visible=False)
|
709 |
|
|
|
721 |
outputs=[srv_resp_retrieve_data_box, error_box6],
|
722 |
)
|
723 |
|
724 |
+
gr.Markdown("### Decrypt the output")
|
|
|
|
|
|
|
|
|
725 |
|
726 |
decrypt_target_btn = gr.Button(
|
727 |
"Decrypt the output with the π private secret decryption key π"
|
|
|
734 |
inputs=[user_id_box, user_vect_box1, *check_boxes],
|
735 |
outputs=[decrypt_target_box, error_box7],
|
736 |
)
|
737 |
+
|
738 |
+
gr.Markdown(
|
739 |
+
"""The app was built with [Concrete ML](https://github.com/zama-ai/concrete-ml), a Privacy-Preserving Machine Learning (PPML) open-source set of tools by Zama.
|
740 |
+
Try it yourself and don't forget to star on [Github](https://github.com/zama-ai/concrete-ml) β.
|
741 |
+
""")
|
742 |
|
743 |
gen_key_btn.click(
|
744 |
key_gen_fn,
|
|
|
773 |
error_box7,
|
774 |
disease_box,
|
775 |
default_symptoms,
|
|
|
776 |
user_id_box,
|
777 |
key_len_box,
|
778 |
key_box,
|