print hex() encryption
#12
by
80cols
- opened
- predictor.py +2 -2
predictor.py
CHANGED
@@ -53,7 +53,7 @@ def predict():
|
|
53 |
encrypted_data, serialized_evaluation_keys=evaluation_keys
|
54 |
)
|
55 |
logging.info(f"Encrypted Prediction: {encrypted_prediction}")
|
56 |
-
return encrypted_prediction, gr.update(value="FHE evaluation is done. β
")
|
57 |
|
58 |
except Exception as e:
|
59 |
logging.error(f"Error during prediction: {e}")
|
@@ -119,7 +119,7 @@ def pre_process_encrypt_send_purchase(*inputs):
|
|
119 |
# Encrypt the scaled data
|
120 |
encrypted_data = client.quantize_encrypt_serialize(scaled_data)
|
121 |
logging.info("Data encrypted successfully.")
|
122 |
-
return encrypted_data, gr.update(value="Inputs are encrypted and sent to server. β
")
|
123 |
except Exception as e:
|
124 |
logging.error(f"Error during pre-processing: {e}")
|
125 |
return "Error during pre-processing"
|
|
|
53 |
encrypted_data, serialized_evaluation_keys=evaluation_keys
|
54 |
)
|
55 |
logging.info(f"Encrypted Prediction: {encrypted_prediction}")
|
56 |
+
return encrypted_prediction.hex(), gr.update(value="FHE evaluation is done. β
")
|
57 |
|
58 |
except Exception as e:
|
59 |
logging.error(f"Error during prediction: {e}")
|
|
|
119 |
# Encrypt the scaled data
|
120 |
encrypted_data = client.quantize_encrypt_serialize(scaled_data)
|
121 |
logging.info("Data encrypted successfully.")
|
122 |
+
return encrypted_data.hex(), gr.update(value="Inputs are encrypted and sent to server. β
")
|
123 |
except Exception as e:
|
124 |
logging.error(f"Error during pre-processing: {e}")
|
125 |
return "Error during pre-processing"
|