romanbredehoft-zama
commited on
Commit
•
affc682
1
Parent(s):
31284a7
Additional renames
Browse files- app.py +4 -4
- backend.py +4 -4
- data/data.csv +0 -0
- deployment_files/client.zip +2 -2
- deployment_files/pre_processor_third_party.pkl +1 -1
- deployment_files/pre_processor_user.pkl +2 -2
- deployment_files/server.zip +2 -2
- settings.py +2 -2
app.py
CHANGED
@@ -10,7 +10,7 @@ from settings import (
|
|
10 |
CHILDREN_MIN_MAX,
|
11 |
INCOME_MIN_MAX,
|
12 |
AGE_MIN_MAX,
|
13 |
-
|
14 |
FAMILY_MIN_MAX,
|
15 |
INCOME_TYPES,
|
16 |
OCCUPATION_TYPES,
|
@@ -94,8 +94,8 @@ with demo:
|
|
94 |
|
95 |
with gr.Column():
|
96 |
gr.Markdown("### Third party ")
|
97 |
-
|
98 |
-
|
99 |
|
100 |
|
101 |
gr.Markdown("## Step 3: Encrypt the inputs using FHE and send them to the server.")
|
@@ -201,7 +201,7 @@ with demo:
|
|
201 |
# client side to the server
|
202 |
encrypt_button_third_party.click(
|
203 |
pre_process_encrypt_send_third_party,
|
204 |
-
inputs=[client_id,
|
205 |
outputs=[encrypted_input_third_party],
|
206 |
)
|
207 |
|
|
|
10 |
CHILDREN_MIN_MAX,
|
11 |
INCOME_MIN_MAX,
|
12 |
AGE_MIN_MAX,
|
13 |
+
EMPLOYED_MIN_MAX,
|
14 |
FAMILY_MIN_MAX,
|
15 |
INCOME_TYPES,
|
16 |
OCCUPATION_TYPES,
|
|
|
94 |
|
95 |
with gr.Column():
|
96 |
gr.Markdown("### Third party ")
|
97 |
+
employed = gr.Radio(["Yes", "No"], label="Is the person employed ?", value="Yes")
|
98 |
+
years_employed = gr.Slider(**EMPLOYED_MIN_MAX, step=1, label="Years of employment", info="How long have this person been employed (in years) ?")
|
99 |
|
100 |
|
101 |
gr.Markdown("## Step 3: Encrypt the inputs using FHE and send them to the server.")
|
|
|
201 |
# client side to the server
|
202 |
encrypt_button_third_party.click(
|
203 |
pre_process_encrypt_send_third_party,
|
204 |
+
inputs=[client_id, employed, years_employed],
|
205 |
outputs=[encrypted_input_third_party],
|
206 |
)
|
207 |
|
backend.py
CHANGED
@@ -306,13 +306,13 @@ def pre_process_encrypt_send_third_party(client_id, *inputs):
|
|
306 |
(int, bytes): Integer ID representing the current client and a byte short representation of
|
307 |
the encrypted input to send.
|
308 |
"""
|
309 |
-
|
310 |
|
311 |
-
|
312 |
|
313 |
third_party_inputs = pandas.DataFrame({
|
314 |
-
"
|
315 |
-
"Years_employed": [
|
316 |
})
|
317 |
|
318 |
third_party_inputs = third_party_inputs.reindex(THIRD_PARTY_COLUMNS, axis=1)
|
|
|
306 |
(int, bytes): Integer ID representing the current client and a byte short representation of
|
307 |
the encrypted input to send.
|
308 |
"""
|
309 |
+
employed, years_employed = inputs
|
310 |
|
311 |
+
is_employed = employed == "Yes"
|
312 |
|
313 |
third_party_inputs = pandas.DataFrame({
|
314 |
+
"Employed": [is_employed],
|
315 |
+
"Years_employed": [years_employed],
|
316 |
})
|
317 |
|
318 |
third_party_inputs = third_party_inputs.reindex(THIRD_PARTY_COLUMNS, axis=1)
|
data/data.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
deployment_files/client.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3a407200f51839a85032c3f69ca3413e9cdb99d2e03722f03450599d2f8d318d
|
3 |
+
size 76138
|
deployment_files/pre_processor_third_party.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 1588
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:223d27a2af60a06845da0191cf725b7bab7f31ebb0a84bc530cbd32001ac4f47
|
3 |
size 1588
|
deployment_files/pre_processor_user.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:60f9d3d6e98f3eadc7a30340dae414df3f42fabd73da01fe0a6ece91186964b5
|
3 |
+
size 6222
|
deployment_files/server.zip
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:98a6a55f0be2a5fc9b2174b9a9686550fe2a89c3c2ae937aeb31e4057f645a03
|
3 |
+
size 3419
|
settings.py
CHANGED
@@ -51,7 +51,7 @@ USER_COLUMNS = [
|
|
51 |
'Occupation_type',
|
52 |
]
|
53 |
BANK_COLUMNS = ["Account_age"]
|
54 |
-
THIRD_PARTY_COLUMNS = ["Years_employed", "
|
55 |
|
56 |
_data = pandas.read_csv(DATA_PATH, encoding="utf-8")
|
57 |
|
@@ -67,7 +67,7 @@ ACCOUNT_MIN_MAX = get_min_max(_data, "Account_age")
|
|
67 |
CHILDREN_MIN_MAX = get_min_max(_data, "Num_children")
|
68 |
INCOME_MIN_MAX = get_min_max(_data, "Total_income")
|
69 |
AGE_MIN_MAX = get_min_max(_data, "Age")
|
70 |
-
|
71 |
FAMILY_MIN_MAX = get_min_max(_data, "Household_size")
|
72 |
|
73 |
# App data choices
|
|
|
51 |
'Occupation_type',
|
52 |
]
|
53 |
BANK_COLUMNS = ["Account_age"]
|
54 |
+
THIRD_PARTY_COLUMNS = ["Years_employed", "Employed"]
|
55 |
|
56 |
_data = pandas.read_csv(DATA_PATH, encoding="utf-8")
|
57 |
|
|
|
67 |
CHILDREN_MIN_MAX = get_min_max(_data, "Num_children")
|
68 |
INCOME_MIN_MAX = get_min_max(_data, "Total_income")
|
69 |
AGE_MIN_MAX = get_min_max(_data, "Age")
|
70 |
+
EMPLOYED_MIN_MAX = get_min_max(_data, "Years_employed")
|
71 |
FAMILY_MIN_MAX = get_min_max(_data, "Household_size")
|
72 |
|
73 |
# App data choices
|