Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mlflow fix #286

Merged
merged 10 commits into from
Jun 14, 2024
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.0
hooks:
- id: black
exclude: ^apax/utils/jax_md_reduced/
Expand Down
9 changes: 5 additions & 4 deletions apax/nodes/md.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,11 @@ def _handle_parameter_file(self):
def run(self):
"""Primary method to run which executes all steps of the model training"""

atoms = self.data[self.data_id]
if self.repeat is not None:
atoms = atoms.repeat(self.repeat)
ase.io.write(self.init_struc_dir.as_posix(), atoms)
if not self.state.restarted:
atoms = self.data[self.data_id]
if self.repeat is not None:
atoms = atoms.repeat(self.repeat)
ase.io.write(self.init_struc_dir.as_posix(), atoms)

run_md(self.model._parameter, self._parameter)

Expand Down
6 changes: 3 additions & 3 deletions apax/nodes/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def _post_load_(self) -> None:
self._handle_parameter_file()

def _handle_parameter_file(self):
with self.state.use_tmp_path():
self._parameter = yaml.safe_load(pathlib.Path(self.config).read_text())
self._parameter = yaml.safe_load(self.state.fs.read_text(self.config))

with self.state.use_tmp_path():
custom_parameters = {
"directory": self.model_directory.resolve().as_posix(),
"directory": self.model_directory.as_posix(),
"experiment": "",
"train_data_path": self.train_data_file.as_posix(),
"val_data_path": self.validation_data_file.as_posix(),
Expand Down
Loading
Loading