From 4550447409a7895de8627718d03bd6bfd14577df Mon Sep 17 00:00:00 2001 From: robcaulk Date: Tue, 14 Mar 2023 21:13:30 +0100 Subject: [PATCH] cheat flake8 for now until we can refactor save into the model class --- freqtrade/freqai/data_drawer.py | 4 ++-- freqtrade/freqai/freqai_interface.py | 2 +- .../freqai/prediction_models/PyTorchClassifierMultiTarget.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/freqtrade/freqai/data_drawer.py b/freqtrade/freqai/data_drawer.py index aaf9a869c..c8dadb171 100644 --- a/freqtrade/freqai/data_drawer.py +++ b/freqtrade/freqai/data_drawer.py @@ -446,7 +446,7 @@ class FreqaiDataDrawer: dump(model, save_path / f"{dk.model_filename}_model.joblib") elif self.model_type == 'keras': model.save(save_path / f"{dk.model_filename}_model.h5") - elif self.model_type in ["stable_baselines", "sb3_contrib", "pytorch"]: + elif self.model_type in ["stable_baselines3", "sb3_contrib", "pytorch"]: model.save(save_path / f"{dk.model_filename}_model.zip") if dk.svm_model is not None: @@ -496,7 +496,7 @@ class FreqaiDataDrawer: dk.training_features_list = dk.data["training_features_list"] dk.label_list = dk.data["label_list"] - def load_data(self, coin: str, dk: FreqaiDataKitchen) -> Any: + def load_data(self, coin: str, dk: FreqaiDataKitchen) -> Any: # noqa: C901 """ loads all data required to make a prediction on a sub-train time range :returns: diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index 7c45d4642..8a1ac436b 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -563,7 +563,7 @@ class IFreqaiModel(ABC): file_type = ".joblib" elif self.dd.model_type == 'keras': file_type = ".h5" - elif self.dd.model_type in ["stable_baselines", "sb3_contrib", "pytorch"]: + elif self.dd.model_type in ["stable_baselines3", "sb3_contrib", "pytorch"]: file_type = ".zip" path_to_modelfile = Path(dk.data_path / f"{dk.model_filename}_model{file_type}") diff --git a/freqtrade/freqai/prediction_models/PyTorchClassifierMultiTarget.py b/freqtrade/freqai/prediction_models/PyTorchClassifierMultiTarget.py index edafb3b7a..967199c12 100644 --- a/freqtrade/freqai/prediction_models/PyTorchClassifierMultiTarget.py +++ b/freqtrade/freqai/prediction_models/PyTorchClassifierMultiTarget.py @@ -41,7 +41,7 @@ class PyTorchClassifierMultiTarget(BasePyTorchModel): self.max_n_eval_batches: Optional[int] = model_training_params.get( "max_n_eval_batches", None ) - self.model_kwargs: Dict = model_training_params.get("model_kwargs", {}) + self.model_kwargs: Dict[str, any] = model_training_params.get("model_kwargs", {}) self.class_name_to_index = None self.index_to_class_name = None