WenqingZhang commited on
Commit
b857f12
Β·
verified Β·
1 Parent(s): dd4569d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -108,11 +108,11 @@ def encode_quantize_encrypt(text, user_id):
108
  if "legal_rating" in model_names:
109
  fhe_api = FHEModelClient(FHE_LEGAL_PATH, f".fhe_keys/{user_id}")
110
  encodings =vectorizer.fit_transform([text]).toarray()
111
- if dense_matrix.shape[1] < 1736:
112
  # εœ¨εŽι’ε‘«ε……ι›Ά
113
  padding = np.zeros((1, 1736 - dense_matrix.shape[1]))
114
- dense_matrix = np.hstack((dense_matrix, padding))
115
- elif dense_matrix.shape[1] > 1736:
116
  # ζˆͺ取前1736εˆ—
117
  encodings = dense_matrix[:, :1736]
118
  else:
 
108
  if "legal_rating" in model_names:
109
  fhe_api = FHEModelClient(FHE_LEGAL_PATH, f".fhe_keys/{user_id}")
110
  encodings =vectorizer.fit_transform([text]).toarray()
111
+ if encodings.shape[1] < 1736:
112
  # εœ¨εŽι’ε‘«ε……ι›Ά
113
  padding = np.zeros((1, 1736 - dense_matrix.shape[1]))
114
+ encodings = np.hstack((dense_matrix, padding))
115
+ elif encodings.shape[1] > 1736:
116
  # ζˆͺ取前1736εˆ—
117
  encodings = dense_matrix[:, :1736]
118
  else: