Skip to content

Commit

Permalink
Clean up too verbose logs pt. 2 (#2298)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #2298

Reviewed By: saitcakmak

Differential Revision: D54885252

fbshipit-source-id: e24b502319493e8cb2abdfa196a16b14501c48e0
  • Loading branch information
Lena Kashtelyan authored and facebook-github-bot committed Apr 3, 2024
1 parent 0014c75 commit ec3aa36
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ax/modelbridge/tests/test_model_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_fit(self, wrapped_extract_ssd: Mock) -> None:
# This should skip the model fit.
with mock.patch("ax.modelbridge.torch.logger") as mock_logger:
ms.fit(experiment=self.experiment, data=self.data)
mock_logger.info.assert_called_with(
mock_logger.debug.assert_called_with(
"The observations are identical to the last set of observations "
"used to fit the model. Skipping model fitting."
)
Expand Down
2 changes: 1 addition & 1 deletion ax/modelbridge/tests/test_torch_modelbridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def test_TorchModelBridge(
self.assertIsNone(model_fit_args["candidate_metadata"])
self.assertEqual(ma._last_observations, observations)

with mock.patch(f"{TorchModelBridge.__module__}.logger.info") as mock_logger:
with mock.patch(f"{TorchModelBridge.__module__}.logger.debug") as mock_logger:
ma._fit(
model=model,
search_space=search_space,
Expand Down
2 changes: 1 addition & 1 deletion ax/modelbridge/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def _fit(
**kwargs: Any,
) -> None:
if self.model is not None and observations == self._last_observations:
logger.info(
logger.debug(
"The observations are identical to the last set of observations "
"used to fit the model. Skipping model fitting."
)
Expand Down

0 comments on commit ec3aa36

Please sign in to comment.