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

Simplify huggingface downloads #2699

Merged
merged 10 commits into from
Mar 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,10 @@ jobs:
run: |
echo "COVERAGE_CORE=sysmon" >> $GITHUB_ENV

- name: Download OMAT24 small checkpoint
- name: huggingface hub login
env:
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
run: |
curl "https://huggingface.co/fairchem/OMAT24/resolve/main/eqV2_31M_omat_mp_salex.pt" -H "Authorization: Bearer $HUGGING_FACE_TOKEN" -L --output tests/core/recipes/mlp_recipes/eqV2_31M_omat_mp_salex.pt
HF_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }}
run: huggingface-cli login --token $HF_TOKEN

- name: Run tests with pytest
run: pytest -k 'mlp or newtonnet or geodesic' --durations=10 --cov=quacc --cov-report=xml
Expand Down
13 changes: 9 additions & 4 deletions tests/core/recipes/mlp_recipes/test_core_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
torch = pytest.importorskip("torch")

from importlib.util import find_spec
from pathlib import Path

import numpy as np
from ase.build import bulk
Expand Down Expand Up @@ -55,8 +54,10 @@ def test_static_job(tmp_path, monkeypatch, method):
_set_dtype(32)

if method == "fairchem":
# Note that for this to work, you need HF_TOKEN env variable set!
calc_kwargs = {
"checkpoint_path": Path(__file__).parent / "eqV2_31M_omat_mp_salex.pt"
"model_name": "EquiformerV2-31M-OMAT24-mp-salex",
"local_cache": "./fairchem_checkpoint_cache/",
}
else:
calc_kwargs = {}
Expand Down Expand Up @@ -101,8 +102,10 @@ def test_relax_job(tmp_path, monkeypatch, method):
_set_dtype(32)

if method == "fairchem":
# Note that for this to work, you need HF_TOKEN env variable set!
calc_kwargs = {
"checkpoint_path": Path(__file__).parent / "eqV2_31M_omat_mp_salex.pt"
"model_name": "EquiformerV2-31M-OMAT24-mp-salex",
"local_cache": "./fairchem_checkpoint_cache/",
}
else:
calc_kwargs = {}
Expand Down Expand Up @@ -151,8 +154,10 @@ def test_relax_cell_job(tmp_path, monkeypatch, method):
_set_dtype(32)

if method == "fairchem":
# Note that for this to work, you need HF_TOKEN env variable set!
calc_kwargs = {
"checkpoint_path": Path(__file__).parent / "eqV2_31M_omat_mp_salex.pt"
"model_name": "EquiformerV2-31M-OMAT24-mp-salex",
"local_cache": "./fairchem_checkpoint_cache/",
}
else:
calc_kwargs = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements-mlp1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ chgnet==0.4.0
torch-dftd==0.5.1
sevenn==0.10.4
orb-models==0.4.2
fairchem-core==1.5.0
fairchem-core==1.7.0
pynanoflann@git+https://github.com/dwastberg/pynanoflann
# Requirements from fairchem-core
torch_geometric==2.6.1
Expand Down
Loading