Spaces:
Runtime error
Runtime error
Commit
·
eea003f
1
Parent(s):
c18c204
commit
Browse files
app.py
CHANGED
@@ -154,9 +154,16 @@ def encrypt_encoded_quantize(encodings):
|
|
154 |
fhe_api = FHEModelClient(f"fhe_model", f".fhe_keys/{eval_key}")
|
155 |
fhe_api.load()
|
156 |
|
157 |
-
|
|
|
158 |
if isinstance(encodings, str):
|
159 |
-
encodings =
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
if np.isnan(encodings).any() or np.isinf(encodings).any():
|
162 |
raise ValueError("Encodings contain NaN or Inf values, which cannot be processed.")
|
|
|
154 |
fhe_api = FHEModelClient(f"fhe_model", f".fhe_keys/{eval_key}")
|
155 |
fhe_api.load()
|
156 |
|
157 |
+
encodings = encodings[0]
|
158 |
+
|
159 |
if isinstance(encodings, str):
|
160 |
+
encodings = safe_eval(encodings)
|
161 |
+
|
162 |
+
encodings = np.array(encodings, dtype=np.float32)
|
163 |
+
|
164 |
+
# Check if the array is empty
|
165 |
+
if encodings.size == 0:
|
166 |
+
raise ValueError("Encodings array is empty, cannot proceed with encryption.")
|
167 |
|
168 |
if np.isnan(encodings).any() or np.isinf(encodings).any():
|
169 |
raise ValueError("Encodings contain NaN or Inf values, which cannot be processed.")
|