romanbredehoft-zama commited on
Commit
affc682
1 Parent(s): 31284a7

Additional renames

Browse files
app.py CHANGED
@@ -10,7 +10,7 @@ from settings import (
10
  CHILDREN_MIN_MAX,
11
  INCOME_MIN_MAX,
12
  AGE_MIN_MAX,
13
- SALARIED_MIN_MAX,
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
- salaried = gr.Radio(["Yes", "No"], label="Is the person salaried ?", value="Yes")
98
- years_salaried = gr.Slider(**SALARIED_MIN_MAX, step=1, label="Years of employment", info="How long have this person been salaried (in years) ?")
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, salaried, years_salaried],
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
- salaried, years_salaried = inputs
310
 
311
- is_salaried = salaried == "Yes"
312
 
313
  third_party_inputs = pandas.DataFrame({
314
- "Salaried": [is_salaried],
315
- "Years_employed": [years_salaried],
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:b698501c432ade8d406a3d83fcff9a86ed59a4c693116d14b72815602b04b1d9
3
- size 75886
 
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:999ae2b4f9420d6b2e2987035cde0f43e93b2edb85ac32b3c877584b45871ca8
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:8454f6f929f89b5dec427d9f6e522a33cde0a49c8dc6f06a650bb0bf90b59913
3
- size 6221
 
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:73e247b96ac6325fde795f2f6e6c8cd43946b5e5979421845283871bb8e0475e
3
- size 3356
 
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", "Salaried"]
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
- SALARIED_MIN_MAX = get_min_max(_data, "Years_employed")
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