Skip to content

Commit

Permalink
empty prediction_strategy cache (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
jduerholt authored Aug 23, 2023
1 parent dd27f41 commit 8d258f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bofire/surrogates/botorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def _prepare_for_dump(self):

def _dumps(self) -> str:
"""Dumps the actual model to a string via pickle as this is not directly json serializable."""
# empty internal caches to get smaller dumps
self.model.prediction_strategy = None
buffer = io.BytesIO()
torch.save(self.model, buffer)
return base64.b64encode(buffer.getvalue()).decode()
Expand Down

0 comments on commit 8d258f2

Please sign in to comment.