Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mariotawfik
commited on
Commit
•
d701849
1
Parent(s):
0cc3b77
Update app.py
Browse files
app.py
CHANGED
@@ -30,8 +30,8 @@ if not os.path.exists("tmp"):
|
|
30 |
os.mkdir("tmp")
|
31 |
|
32 |
|
33 |
-
# Wait
|
34 |
-
time.sleep(
|
35 |
|
36 |
|
37 |
# Encrypted data limit for the browser to display
|
@@ -128,11 +128,11 @@ def encrypt_encoded_quantize(encodings, user_id, eval_key):
|
|
128 |
fhe_api.load()
|
129 |
|
130 |
encodings = np.array(encodings)
|
131 |
-
print(encodings
|
132 |
quantized_encodings = fhe_api.model.quantize_input(encodings).astype(numpy.uint8)
|
133 |
-
print(quantized_encodings
|
134 |
encrypted_quantized_encoding = fhe_api.quantize_encrypt_serialize(encodings)
|
135 |
-
print(encrypted_quantized_encoding
|
136 |
|
137 |
numpy.save(
|
138 |
f"tmp/tmp_encrypted_quantized_encoding_{user_id}.npy",
|
|
|
30 |
os.mkdir("tmp")
|
31 |
|
32 |
|
33 |
+
# Wait 5 sec for the server to start
|
34 |
+
time.sleep(5)
|
35 |
|
36 |
|
37 |
# Encrypted data limit for the browser to display
|
|
|
128 |
fhe_api.load()
|
129 |
|
130 |
encodings = np.array(encodings)
|
131 |
+
print(encodings)
|
132 |
quantized_encodings = fhe_api.model.quantize_input(encodings).astype(numpy.uint8)
|
133 |
+
print(quantized_encodings)
|
134 |
encrypted_quantized_encoding = fhe_api.quantize_encrypt_serialize(encodings)
|
135 |
+
print(encrypted_quantized_encoding)
|
136 |
|
137 |
numpy.save(
|
138 |
f"tmp/tmp_encrypted_quantized_encoding_{user_id}.npy",
|