Skip to content

Commit

Permalink
update github workflows and update installation instruction in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghan-microsoft committed Nov 26, 2024
1 parent b520c80 commit 52cf4a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ on:

jobs:
build_and_test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-latest]

steps:
- name: Checkout repository
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,16 @@ python setup.py build_ext --inplace
## Usage
### A minimal test
```python
import torch
from mattersim.forcefield.potential import Potential
from mattersim.datasets.utils.build import build_dataloader

potential = Potential.load(load_path="/path/to/checkpoint", device="cuda:0")
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Running MatterSim on {device}")
potential = Potential.load(load_path="pretrained_models/mattersim-v1.0.0-1M.pth", device=device)
from ase.build import bulk
si = bulk("Si", "diamond", a=5.43)
dataloader = build_dataloader([si], only_inference=True, model_type=model_name)
dataloader = build_dataloader([si], only_inference=True)
predictions = potential.predict_properties(dataloader, include_forces=True, include_stresses=True)
print(predictions)
```
Expand Down

0 comments on commit 52cf4a3

Please sign in to comment.