Commit
·
8a003cf
1
Parent(s):
1ad0c1c
Change to vertical display for inputs
Browse files
app.py
CHANGED
|
@@ -87,6 +87,8 @@ with demo:
|
|
| 87 |
household_size = gr.Slider(**FAMILY_MIN_MAX, step=1, label="Household size", info="How many members does your household have ?")
|
| 88 |
total_income = gr.Slider(**INCOME_MIN_MAX, label="Income", info="What's you total yearly income (in euros) ?")
|
| 89 |
age = gr.Slider(**AGE_MIN_MAX, step=1, label="Age", info="How old are you ?")
|
|
|
|
|
|
|
| 90 |
income_type = gr.Dropdown(choices=INCOME_TYPES, value=INCOME_TYPES[0], label="Income type", info="What is your main type of income ?")
|
| 91 |
education_type = gr.Dropdown(choices=EDUCATION_TYPES, value=EDUCATION_TYPES[0], label="Education", info="What is your education background ?")
|
| 92 |
family_status = gr.Dropdown(choices=FAMILY_STATUS, value=FAMILY_STATUS[0], label="Family", info="What is your family status ?")
|
|
@@ -94,37 +96,31 @@ with demo:
|
|
| 94 |
housing_type = gr.Dropdown(choices=HOUSING_TYPES, value=HOUSING_TYPES[0], label="Housing", info="In what type of housing do you live ?")
|
| 95 |
|
| 96 |
with gr.Column():
|
| 97 |
-
gr.Markdown("### Bank ")
|
| 98 |
-
account_age = gr.Slider(**ACCOUNT_MIN_MAX, step=1, label="Account age (months)", info="How long have this person had this bank account (in months) ?")
|
| 99 |
-
|
| 100 |
-
with gr.Column():
|
| 101 |
-
gr.Markdown("### Third party ")
|
| 102 |
-
employed = gr.Radio(["Yes", "No"], label="Is the person employed ?", value="Yes")
|
| 103 |
-
years_employed = gr.Slider(**EMPLOYED_MIN_MAX, step=1, label="Years of employment", info="How long have this person been employed (in years) ?")
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
gr.Markdown("## Step 3: Encrypt the inputs using FHE and send them to the server.")
|
| 107 |
-
with gr.Row():
|
| 108 |
-
with gr.Column():
|
| 109 |
-
gr.Markdown("### User")
|
| 110 |
encrypt_button_user = gr.Button("Encrypt the inputs and send to server.")
|
| 111 |
|
| 112 |
encrypted_input_user = gr.Textbox(
|
| 113 |
label="Encrypted input representation:", max_lines=2, interactive=False
|
| 114 |
)
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
|
| 117 |
with gr.Column():
|
| 118 |
-
gr.Markdown("### Bank ")
|
| 119 |
encrypt_button_bank = gr.Button("Encrypt the inputs and send to server.")
|
| 120 |
|
| 121 |
encrypted_input_bank = gr.Textbox(
|
| 122 |
label="Encrypted input representation:", max_lines=2, interactive=False
|
| 123 |
)
|
| 124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
with gr.Column():
|
| 127 |
-
gr.Markdown("### Third Party ")
|
| 128 |
encrypt_button_third_party = gr.Button("Encrypt the inputs and send to server.")
|
| 129 |
|
| 130 |
encrypted_input_third_party = gr.Textbox(
|
|
@@ -186,7 +182,9 @@ with demo:
|
|
| 186 |
gr.Markdown("## Step 5: Receive the encrypted output from the server and decrypt.")
|
| 187 |
gr.Markdown(
|
| 188 |
"""
|
| 189 |
-
The value displayed below is a shortened byte representation of the actual encrypted
|
|
|
|
|
|
|
| 190 |
"""
|
| 191 |
)
|
| 192 |
|
|
|
|
| 87 |
household_size = gr.Slider(**FAMILY_MIN_MAX, step=1, label="Household size", info="How many members does your household have ?")
|
| 88 |
total_income = gr.Slider(**INCOME_MIN_MAX, label="Income", info="What's you total yearly income (in euros) ?")
|
| 89 |
age = gr.Slider(**AGE_MIN_MAX, step=1, label="Age", info="How old are you ?")
|
| 90 |
+
|
| 91 |
+
with gr.Column():
|
| 92 |
income_type = gr.Dropdown(choices=INCOME_TYPES, value=INCOME_TYPES[0], label="Income type", info="What is your main type of income ?")
|
| 93 |
education_type = gr.Dropdown(choices=EDUCATION_TYPES, value=EDUCATION_TYPES[0], label="Education", info="What is your education background ?")
|
| 94 |
family_status = gr.Dropdown(choices=FAMILY_STATUS, value=FAMILY_STATUS[0], label="Family", info="What is your family status ?")
|
|
|
|
| 96 |
housing_type = gr.Dropdown(choices=HOUSING_TYPES, value=HOUSING_TYPES[0], label="Housing", info="In what type of housing do you live ?")
|
| 97 |
|
| 98 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
encrypt_button_user = gr.Button("Encrypt the inputs and send to server.")
|
| 100 |
|
| 101 |
encrypted_input_user = gr.Textbox(
|
| 102 |
label="Encrypted input representation:", max_lines=2, interactive=False
|
| 103 |
)
|
| 104 |
|
| 105 |
+
with gr.Row():
|
| 106 |
+
with gr.Column(scale=2):
|
| 107 |
+
gr.Markdown("### Bank ")
|
| 108 |
+
account_age = gr.Slider(**ACCOUNT_MIN_MAX, step=1, label="Account age (months)", info="How long have this person had this bank account (in months) ?")
|
| 109 |
|
| 110 |
with gr.Column():
|
|
|
|
| 111 |
encrypt_button_bank = gr.Button("Encrypt the inputs and send to server.")
|
| 112 |
|
| 113 |
encrypted_input_bank = gr.Textbox(
|
| 114 |
label="Encrypted input representation:", max_lines=2, interactive=False
|
| 115 |
)
|
| 116 |
|
| 117 |
+
with gr.Row():
|
| 118 |
+
with gr.Column(scale=2):
|
| 119 |
+
gr.Markdown("### Third party ")
|
| 120 |
+
employed = gr.Radio(["Yes", "No"], label="Is the person employed ?", value="Yes")
|
| 121 |
+
years_employed = gr.Slider(**EMPLOYED_MIN_MAX, step=1, label="Years of employment", info="How long have this person been employed (in years) ?")
|
| 122 |
|
| 123 |
with gr.Column():
|
|
|
|
| 124 |
encrypt_button_third_party = gr.Button("Encrypt the inputs and send to server.")
|
| 125 |
|
| 126 |
encrypted_input_third_party = gr.Textbox(
|
|
|
|
| 182 |
gr.Markdown("## Step 5: Receive the encrypted output from the server and decrypt.")
|
| 183 |
gr.Markdown(
|
| 184 |
"""
|
| 185 |
+
The first value displayed below is a shortened byte representation of the actual encrypted
|
| 186 |
+
output.
|
| 187 |
+
The user is then able to decrypt the value using its private key.
|
| 188 |
"""
|
| 189 |
)
|
| 190 |
|