Skip to content

Commit

Permalink
feat: overwrite the configurable params after reading policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Dec 20, 2024
1 parent 20a445d commit be3a7df
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,13 @@ def _try_recover_policy(self) -> Optional[EGreedyPolicy]:
try:
policy_path = self.params.store_path / POLICY_STORE
with open(policy_path, "r") as f:
policy = f.read()
return EGreedyPolicy.deserialize(policy)
policy_raw = f.read()
policy = EGreedyPolicy.deserialize(policy_raw)
# overwrite the configurable parameters
policy.eps = self.params.epsilon
policy.consecutive_failures_threshold = self.params.policy_threshold
policy.quarantine_duration = self.params.tool_quarantine_duration
return policy
except Exception as e:
self.context.logger.warning(f"Could not recover the policy: {e}.")
return None
Expand Down

0 comments on commit be3a7df

Please sign in to comment.