Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -217,7 +217,7 @@ with demo:
|
|
| 217 |
|
| 218 |
<h2 align="center">📄Cipher Clause</h2>
|
| 219 |
<p align="center">
|
| 220 |
-
<img width=200 src="usecase.jpeg"
|
| 221 |
</p>
|
| 222 |
|
| 223 |
"""
|
|
@@ -239,13 +239,22 @@ with demo:
|
|
| 239 |
- The private key is used to encrypt and decrypt the data and shall never be shared.
|
| 240 |
- The evaluation key is a public key that the server needs to process encrypted data.
|
| 241 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
)
|
| 243 |
gr.Markdown("# Step 0: Select Task")
|
| 244 |
task_checkbox = gr.CheckboxGroup(
|
| 245 |
choices=["legal_rating", "financial_rating"],
|
| 246 |
label="select_tasks"
|
| 247 |
)
|
| 248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 249 |
gr.Markdown("# Step 1: Generate the keys")
|
| 250 |
|
| 251 |
b_gen_key_and_install = gr.Button("Generate all the keys and send public part to server")
|
|
@@ -262,14 +271,22 @@ with demo:
|
|
| 262 |
interactive=False,
|
| 263 |
visible=False
|
| 264 |
)
|
| 265 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 266 |
gr.Markdown("# Step 2: Provide a contract or clause")
|
| 267 |
gr.Markdown("## Client side")
|
| 268 |
gr.Markdown(
|
| 269 |
"Enter a contract or clause you want to analysis)."
|
| 270 |
)
|
| 271 |
text = gr.Textbox(label="Enter some words:", value="The Employee is entitled to two weeks of paid vacation annually, to be scheduled at the mutual convenience of the Employee and Employer.")
|
| 272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
gr.Markdown("# Step 3: Encode the message with the private key")
|
| 274 |
b_encode_quantize_text = gr.Button(
|
| 275 |
"Encode, quantize and encrypt the text with vectorizer, and send to server"
|
|
@@ -289,7 +306,11 @@ with demo:
|
|
| 289 |
max_lines=4,
|
| 290 |
interactive=False,
|
| 291 |
)
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
gr.Markdown("# Step 4: Run the FHE evaluation")
|
| 294 |
gr.Markdown("## Server side")
|
| 295 |
gr.Markdown(
|
|
@@ -302,7 +323,11 @@ with demo:
|
|
| 302 |
max_lines=4,
|
| 303 |
interactive=False,
|
| 304 |
)
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
gr.Markdown("# Step 5: Decrypt the class")
|
| 307 |
gr.Markdown("## Client side")
|
| 308 |
gr.Markdown(
|
|
|
|
| 217 |
|
| 218 |
<h2 align="center">📄Cipher Clause</h2>
|
| 219 |
<p align="center">
|
| 220 |
+
<img width=200 src="usecase.jpeg">
|
| 221 |
</p>
|
| 222 |
|
| 223 |
"""
|
|
|
|
| 239 |
- The private key is used to encrypt and decrypt the data and shall never be shared.
|
| 240 |
- The evaluation key is a public key that the server needs to process encrypted data.
|
| 241 |
"""
|
| 242 |
+
)
|
| 243 |
+
gr.Markdown(
|
| 244 |
+
"""
|
| 245 |
+
<hr/>
|
| 246 |
+
"""
|
| 247 |
)
|
| 248 |
gr.Markdown("# Step 0: Select Task")
|
| 249 |
task_checkbox = gr.CheckboxGroup(
|
| 250 |
choices=["legal_rating", "financial_rating"],
|
| 251 |
label="select_tasks"
|
| 252 |
)
|
| 253 |
+
gr.Markdown(
|
| 254 |
+
"""
|
| 255 |
+
<hr/>
|
| 256 |
+
"""
|
| 257 |
+
)
|
| 258 |
gr.Markdown("# Step 1: Generate the keys")
|
| 259 |
|
| 260 |
b_gen_key_and_install = gr.Button("Generate all the keys and send public part to server")
|
|
|
|
| 271 |
interactive=False,
|
| 272 |
visible=False
|
| 273 |
)
|
| 274 |
+
gr.Markdown(
|
| 275 |
+
"""
|
| 276 |
+
<hr/>
|
| 277 |
+
"""
|
| 278 |
+
)
|
| 279 |
gr.Markdown("# Step 2: Provide a contract or clause")
|
| 280 |
gr.Markdown("## Client side")
|
| 281 |
gr.Markdown(
|
| 282 |
"Enter a contract or clause you want to analysis)."
|
| 283 |
)
|
| 284 |
text = gr.Textbox(label="Enter some words:", value="The Employee is entitled to two weeks of paid vacation annually, to be scheduled at the mutual convenience of the Employee and Employer.")
|
| 285 |
+
gr.Markdown(
|
| 286 |
+
"""
|
| 287 |
+
<hr/>
|
| 288 |
+
"""
|
| 289 |
+
)
|
| 290 |
gr.Markdown("# Step 3: Encode the message with the private key")
|
| 291 |
b_encode_quantize_text = gr.Button(
|
| 292 |
"Encode, quantize and encrypt the text with vectorizer, and send to server"
|
|
|
|
| 306 |
max_lines=4,
|
| 307 |
interactive=False,
|
| 308 |
)
|
| 309 |
+
gr.Markdown(
|
| 310 |
+
"""
|
| 311 |
+
<hr/>
|
| 312 |
+
"""
|
| 313 |
+
)
|
| 314 |
gr.Markdown("# Step 4: Run the FHE evaluation")
|
| 315 |
gr.Markdown("## Server side")
|
| 316 |
gr.Markdown(
|
|
|
|
| 323 |
max_lines=4,
|
| 324 |
interactive=False,
|
| 325 |
)
|
| 326 |
+
gr.Markdown(
|
| 327 |
+
"""
|
| 328 |
+
<hr/>
|
| 329 |
+
"""
|
| 330 |
+
)
|
| 331 |
gr.Markdown("# Step 5: Decrypt the class")
|
| 332 |
gr.Markdown("## Client side")
|
| 333 |
gr.Markdown(
|