Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -686,40 +686,24 @@ with demo:
|
|
| 686 |
)
|
| 687 |
|
| 688 |
########################## FHE processing Part ##########################
|
| 689 |
-
|
| 690 |
gr.Markdown("<hr />")
|
| 691 |
-
gr.Markdown("## Step 3: De-identify the
|
| 692 |
gr.Markdown(
|
| 693 |
-
"""Once the client encrypts the
|
| 694 |
server to perform the de-identification on encrypted data. When the computation is done, the
|
| 695 |
server will return the result to the client for decryption."""
|
| 696 |
-
|
| 697 |
)
|
| 698 |
|
| 699 |
run_fhe_btn = gr.Button("De-identify using FHE")
|
| 700 |
|
| 701 |
with gr.Row():
|
| 702 |
with gr.Column(scale=5):
|
| 703 |
-
|
| 704 |
-
anonymized_doc_output = gr.Textbox(
|
| 705 |
-
label="Decrypted and de-idenntified document", lines=10, interactive=True
|
| 706 |
-
)
|
| 707 |
-
|
| 708 |
-
with gr.Column(scale=5):
|
| 709 |
-
|
| 710 |
anonymized_query_output = gr.Textbox(
|
| 711 |
label="Decrypted and de-identified prompt", lines=10, interactive=True
|
| 712 |
)
|
| 713 |
-
|
| 714 |
-
|
| 715 |
identified_words_output_df = gr.Dataframe(label="Identified words:", visible=False)
|
| 716 |
|
| 717 |
-
encrypt_doc_btn.click(
|
| 718 |
-
fn=encrypt_doc_fn,
|
| 719 |
-
inputs=[original_sentences_box],
|
| 720 |
-
outputs=[encrypted_doc_box, anonymized_doc_output],
|
| 721 |
-
)
|
| 722 |
-
|
| 723 |
encrypt_query_btn.click(
|
| 724 |
fn=encrypt_query_fn,
|
| 725 |
inputs=[query_box],
|
|
@@ -733,10 +717,9 @@ with demo:
|
|
| 733 |
|
| 734 |
run_fhe_btn.click(
|
| 735 |
anonymization_with_fn,
|
| 736 |
-
inputs=[
|
| 737 |
-
outputs=[
|
| 738 |
)
|
| 739 |
-
|
| 740 |
|
| 741 |
########################## Presidio ##########################
|
| 742 |
gr.Markdown("<hr />")
|
|
|
|
| 686 |
)
|
| 687 |
|
| 688 |
########################## FHE processing Part ##########################
|
|
|
|
| 689 |
gr.Markdown("<hr />")
|
| 690 |
+
gr.Markdown("## Step 3: De-identify the prompt using FHE")
|
| 691 |
gr.Markdown(
|
| 692 |
+
"""Once the client encrypts the prompt locally, it will be sent to a remote
|
| 693 |
server to perform the de-identification on encrypted data. When the computation is done, the
|
| 694 |
server will return the result to the client for decryption."""
|
|
|
|
| 695 |
)
|
| 696 |
|
| 697 |
run_fhe_btn = gr.Button("De-identify using FHE")
|
| 698 |
|
| 699 |
with gr.Row():
|
| 700 |
with gr.Column(scale=5):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 701 |
anonymized_query_output = gr.Textbox(
|
| 702 |
label="Decrypted and de-identified prompt", lines=10, interactive=True
|
| 703 |
)
|
| 704 |
+
|
|
|
|
| 705 |
identified_words_output_df = gr.Dataframe(label="Identified words:", visible=False)
|
| 706 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 707 |
encrypt_query_btn.click(
|
| 708 |
fn=encrypt_query_fn,
|
| 709 |
inputs=[query_box],
|
|
|
|
| 717 |
|
| 718 |
run_fhe_btn.click(
|
| 719 |
anonymization_with_fn,
|
| 720 |
+
inputs=[query_box],
|
| 721 |
+
outputs=[anonymized_query_output, identified_words_output_df],
|
| 722 |
)
|
|
|
|
| 723 |
|
| 724 |
########################## Presidio ##########################
|
| 725 |
gr.Markdown("<hr />")
|