Skip to content

Commit

Permalink
fix import sort and add OMAT-0
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyes319 committed Feb 4, 2025
1 parent bb2162c commit 76f5790
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions mace/calculators/foundations_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def download_mace_mp_checkpoint(model: Union[str, Path] = None) -> str:
"large-0b2": "https://github.com/ACEsuit/mace-mp/releases/download/mace_mp_0b2/mace-large-density-agnesi-stress.model",
"medium-0b3": "https://github.com/ACEsuit/mace-mp/releases/download/mace_mp_0b3/mace-mp-0b3-medium.model",
"medium-mpa-0": "https://github.com/ACEsuit/mace-mp/releases/download/mace_mpa_0/mace-mpa-0-medium.model",
"medium-omat-0": "https://github.com/ACEsuit/mace-mp/releases/download/mace_omat_0/mace-omat-0-medium.model",
}

checkpoint_url = (
Expand All @@ -57,6 +58,7 @@ def download_mace_mp_checkpoint(model: Union[str, Path] = None) -> str:
"large-0b2",
"medium-0b3",
"medium-mpa-0",
"medium-omat-0",
)
else model
)
Expand All @@ -65,6 +67,10 @@ def download_mace_mp_checkpoint(model: Union[str, Path] = None) -> str:
print(
"Using medium MPA-0 model as default MACE-MP model, to use previous (before 3.10) default model please specify 'medium' as model argument"
)
if checkpoint_url == urls["medium-omat-0"]:
print(
"Using medium OMAT-0 model under Academic Software License (ASL) license, see https://github.com/gabor1/ASL \n To use this model you accept the terms of the license."
)

cache_dir = os.path.expanduser("~/.cache/mace")
checkpoint_url_name = "".join(
Expand Down Expand Up @@ -138,6 +144,7 @@ def mace_mp(
"medium-0b2",
"medium-0b3",
"large-0b2",
"medium-omat-0",
) or str(model).startswith("https:"):
model_path = download_mace_mp_checkpoint(model)
print(f"Using Materials Project MACE for MACECalculator with {model_path}")
Expand Down
3 changes: 2 additions & 1 deletion mace/calculators/mace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
# This program is distributed under the MIT License (see MIT.md)
###########################################################################################

import logging

# pylint: disable=wrong-import-position
import os
import logging
from glob import glob
from pathlib import Path
from typing import List, Union
Expand Down
2 changes: 1 addition & 1 deletion mace/cli/create_lammps_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pylint: disable=wrong-import-position
import os
import argparse
import os

os.environ["TORCH_FORCE_NO_WEIGHTS_ONLY_LOAD"] = "1"

Expand Down

0 comments on commit 76f5790

Please sign in to comment.