add freqai.model_exists pytorch file type support

This commit is contained in:
Yinon Polak 2023-03-06 18:10:49 +02:00
parent 7eedcb9c14
commit 125085fbaf

View File

@ -563,8 +563,11 @@ class IFreqaiModel(ABC):
file_type = ".joblib" file_type = ".joblib"
elif self.dd.model_type == 'keras': elif self.dd.model_type == 'keras':
file_type = ".h5" file_type = ".h5"
elif 'stable_baselines' in self.dd.model_type or 'sb3_contrib' == self.dd.model_type: elif ('stable_baselines' in self.dd.model_type or
'sb3_contrib' == self.dd.model_type or
'pytorch' == self.dd.model_type):
file_type = ".zip" file_type = ".zip"
path_to_modelfile = Path(dk.data_path / f"{dk.model_filename}_model{file_type}") path_to_modelfile = Path(dk.data_path / f"{dk.model_filename}_model{file_type}")
file_exists = path_to_modelfile.is_file() file_exists = path_to_modelfile.is_file()
if file_exists: if file_exists: