From 6b889814ad975ab4e159823b0e0402f4ba178627 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 5 May 2024 19:26:14 +0200 Subject: [PATCH] chore: Fix further "mutable arguments" call --- freqtrade/freqai/torch/PyTorchModelTrainer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqai/torch/PyTorchModelTrainer.py b/freqtrade/freqai/torch/PyTorchModelTrainer.py index 54c42a284..b10de906c 100644 --- a/freqtrade/freqai/torch/PyTorchModelTrainer.py +++ b/freqtrade/freqai/torch/PyTorchModelTrainer.py @@ -25,7 +25,7 @@ class PyTorchModelTrainer(PyTorchTrainerInterface): criterion: nn.Module, device: str, data_convertor: PyTorchDataConvertor, - model_meta_data: Dict[str, Any] = {}, + model_meta_data: Optional[Dict[str, Any]] = None, window_size: int = 1, tb_logger: Any = None, **kwargs, @@ -45,6 +45,8 @@ class PyTorchModelTrainer(PyTorchTrainerInterface): :param n_epochs: The maximum number batches to use for evaluation. :param batch_size: The size of the batches to use during training. """ + if model_meta_data is None: + model_meta_data = {} self.model = model self.optimizer = optimizer self.criterion = criterion