Spaces:
Runtime error
Runtime error
add submit, remove live true
Browse files
app.py
CHANGED
|
@@ -48,6 +48,10 @@ def secure_encoding(input_data):
|
|
| 48 |
"Data processing is complete. The encrypted data and count have been generated."
|
| 49 |
)
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
# Gradio Interface
|
| 52 |
iface = gr.Interface(
|
| 53 |
fn=secure_encoding,
|
|
@@ -58,12 +62,15 @@ iface = gr.Interface(
|
|
| 58 |
gr.Textbox("text", label="Decrypted Count"),
|
| 59 |
gr.Textbox("text", label="Process Description")
|
| 60 |
],
|
| 61 |
-
live=True,
|
| 62 |
title="Paillier Encryption Demonstration",
|
| 63 |
description="This app demonstrates Paillier encryption. Enter data (e.g., smokers, non-smokers) in the textbox, and the app will perform encryption and homomorphic addition.",
|
| 64 |
examples=[
|
| 65 |
["smokers", "non-smokers", "smokers", "smokers", "non-smokers", "smokers", "non-smokers"],
|
| 66 |
["smokers", "non-smokers", "non-smokers", "smokers", "smokers", "non-smokers", "smokers"]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
]
|
| 68 |
)
|
| 69 |
|
|
|
|
| 48 |
"Data processing is complete. The encrypted data and count have been generated."
|
| 49 |
)
|
| 50 |
|
| 51 |
+
def clear_outputs():
|
| 52 |
+
# Function to clear outputs
|
| 53 |
+
return "", "", "", ""
|
| 54 |
+
|
| 55 |
# Gradio Interface
|
| 56 |
iface = gr.Interface(
|
| 57 |
fn=secure_encoding,
|
|
|
|
| 62 |
gr.Textbox("text", label="Decrypted Count"),
|
| 63 |
gr.Textbox("text", label="Process Description")
|
| 64 |
],
|
|
|
|
| 65 |
title="Paillier Encryption Demonstration",
|
| 66 |
description="This app demonstrates Paillier encryption. Enter data (e.g., smokers, non-smokers) in the textbox, and the app will perform encryption and homomorphic addition.",
|
| 67 |
examples=[
|
| 68 |
["smokers", "non-smokers", "smokers", "smokers", "non-smokers", "smokers", "non-smokers"],
|
| 69 |
["smokers", "non-smokers", "non-smokers", "smokers", "smokers", "non-smokers", "smokers"]
|
| 70 |
+
],
|
| 71 |
+
components=[
|
| 72 |
+
gr.Button(clear_outputs, "Clear Outputs", style="danger"),
|
| 73 |
+
gr.Button("submit", style="success") # Submit button
|
| 74 |
]
|
| 75 |
)
|
| 76 |
|