Commit
·
2087aab
1
Parent(s):
9bbeadf
chore: fix UI markdown and enable clean old keys
Browse files
app.py
CHANGED
|
@@ -50,6 +50,9 @@ def clean_tmp_directory():
|
|
| 50 |
|
| 51 |
|
| 52 |
def keygen():
|
|
|
|
|
|
|
|
|
|
| 53 |
print("Initializing FHEModelClient...")
|
| 54 |
|
| 55 |
# Let's create a user_id
|
|
@@ -243,12 +246,13 @@ with demo:
|
|
| 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:",
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
def keygen():
|
| 53 |
+
# Clean tmp directory if needed
|
| 54 |
+
clean_tmp_directory()
|
| 55 |
+
|
| 56 |
print("Initializing FHEModelClient...")
|
| 57 |
|
| 58 |
# Let's create a user_id
|
|
|
|
| 246 |
"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)."
|
| 247 |
)
|
| 248 |
text = gr.Textbox(label="Enter a message:", value="I really like your work recently")
|
| 249 |
+
|
| 250 |
+
gr.Markdown("# Step 3: Encode the message with the private key")
|
| 251 |
b_encode_quantize_text = gr.Button(
|
| 252 |
"Encode, quantize and encrypt the text with transformer vectorizer, and send to server"
|
| 253 |
)
|
| 254 |
size_text = gr.Number(label="Size of the text (in bytes):", value="0", interactive=False)
|
| 255 |
|
|
|
|
| 256 |
with gr.Row():
|
| 257 |
encoding = gr.Textbox(
|
| 258 |
label="Transformer representation:",
|