Commit
·
9bbeadf
1
Parent(s):
29d0dc3
chore: update UI with step numbering
Browse files
app.py
CHANGED
@@ -216,7 +216,9 @@ with demo:
|
|
216 |
"""
|
217 |
)
|
218 |
|
219 |
-
|
|
|
|
|
220 |
|
221 |
evaluation_key = gr.Textbox(
|
222 |
label="Evaluation key (truncated):",
|
@@ -235,18 +237,18 @@ with demo:
|
|
235 |
label="Size of the evalution key (in bytes):", value=0, interactive=False
|
236 |
)
|
237 |
|
238 |
-
#
|
239 |
-
|
240 |
gr.Markdown("## Client side")
|
241 |
gr.Markdown(
|
242 |
"Enter a sensitive text message you received and would like to do sentiment analysis on (ideas: the last text message of your boss.... or lover)."
|
243 |
)
|
244 |
text = gr.Textbox(label="Enter a message:", value="I really like your work recently")
|
245 |
-
size_text = gr.Number(label="Size of the text (in bytes):", value=0, interactive=False)
|
246 |
b_encode_quantize_text = gr.Button(
|
247 |
"Encode, quantize and encrypt the text with transformer vectorizer, and send to server"
|
248 |
)
|
|
|
249 |
|
|
|
250 |
with gr.Row():
|
251 |
encoding = gr.Textbox(
|
252 |
label="Transformer representation:",
|
@@ -270,6 +272,7 @@ with demo:
|
|
270 |
interactive=False,
|
271 |
)
|
272 |
|
|
|
273 |
gr.Markdown("## Server side")
|
274 |
gr.Markdown(
|
275 |
"The encrypted value is received by the server. Thanks to the evaluation key and to FHE, the server can compute the (encrypted) prediction directly over encrypted values. Once the computation is finished, the server returns the encrypted prediction to the client."
|
@@ -282,6 +285,7 @@ with demo:
|
|
282 |
interactive=False,
|
283 |
)
|
284 |
|
|
|
285 |
gr.Markdown("## Client side")
|
286 |
gr.Markdown(
|
287 |
"The encrypted sentiment is sent back to client, who can finally decrypt it with its private key. Only the client is aware of the original tweet and the prediction."
|
|
|
216 |
"""
|
217 |
)
|
218 |
|
219 |
+
gr.Markdown("# Step 1: Generate the keys")
|
220 |
+
|
221 |
+
b_gen_key_and_install = gr.Button("Generate the keys and send public part to server")
|
222 |
|
223 |
evaluation_key = gr.Textbox(
|
224 |
label="Evaluation key (truncated):",
|
|
|
237 |
label="Size of the evalution key (in bytes):", value=0, interactive=False
|
238 |
)
|
239 |
|
240 |
+
gr.Markdown("# Step 2: Provide a message")
|
|
|
241 |
gr.Markdown("## Client side")
|
242 |
gr.Markdown(
|
243 |
"Enter a sensitive text message you received and would like to do sentiment analysis on (ideas: the last text message of your boss.... or lover)."
|
244 |
)
|
245 |
text = gr.Textbox(label="Enter a message:", value="I really like your work recently")
|
|
|
246 |
b_encode_quantize_text = gr.Button(
|
247 |
"Encode, quantize and encrypt the text with transformer vectorizer, and send to server"
|
248 |
)
|
249 |
+
size_text = gr.Number(label="Size of the text (in bytes):", value="0", interactive=False)
|
250 |
|
251 |
+
gr.Markdown("# Step 3: Encode the message with the private key")
|
252 |
with gr.Row():
|
253 |
encoding = gr.Textbox(
|
254 |
label="Transformer representation:",
|
|
|
272 |
interactive=False,
|
273 |
)
|
274 |
|
275 |
+
gr.Markdown("# Step 4: Run the FHE evaluation")
|
276 |
gr.Markdown("## Server side")
|
277 |
gr.Markdown(
|
278 |
"The encrypted value is received by the server. Thanks to the evaluation key and to FHE, the server can compute the (encrypted) prediction directly over encrypted values. Once the computation is finished, the server returns the encrypted prediction to the client."
|
|
|
285 |
interactive=False,
|
286 |
)
|
287 |
|
288 |
+
gr.Markdown("# Step 5: Decrypt the sentiment")
|
289 |
gr.Markdown("## Client side")
|
290 |
gr.Markdown(
|
291 |
"The encrypted sentiment is sent back to client, who can finally decrypt it with its private key. Only the client is aware of the original tweet and the prediction."
|