Skip to content

Commit

Permalink
fix memory leak error
Browse files Browse the repository at this point in the history
  • Loading branch information
alirezade authored and alirezade committed Jan 31, 2024
1 parent 38588dc commit 8c3e707
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ProcessAnnotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ def process(self, flow):
self.__set_label(flow)

def __predict_label(self, flow):
df = pd.DataFrame(columns=flow.parameters.keys(), data=[flow.parameters.values()])
df.replace('', np.nan, inplace=True)
y_pred = self.ml_model.predict_proba(df, verbose=0)
y_pred_classes = np.argmax(y_pred, axis=0)
flow.add_parameter(Config.Texts.Prediction, self.label_index[str(y_pred_classes)])
flow.add_parameter(Config.Texts.prediction_confidence, str(y_pred[y_pred_classes]))
# df = pd.DataFrame(columns=flow.parameters.keys(), data=[flow.parameters.values()])
# df.replace('', np.nan, inplace=True)
# y_pred = self.ml_model.predict_proba(df, verbose=0)
# y_pred_classes = np.argmax(y_pred, axis=0)
# flow.add_parameter(Config.Texts.Prediction, self.label_index[str(y_pred_classes)])
# flow.add_parameter(Config.Texts.prediction_confidence, str(y_pred[y_pred_classes]))

def __set_label(self, flow):
if self.attacks:
Expand Down

0 comments on commit 8c3e707

Please sign in to comment.