Skip to content

Commit

Permalink
Add hubconf.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Nov 27, 2023
1 parent 51496ed commit 3b107f7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Materials Graph Library <img src="https://github.com/materialsvirtuallab/matgl/blob/main/assets/MatGL.png?raw=true" alt="matgl" width="30%" style="float: right">

## Official Documentation [:books:]
## Official Documentation

<https://matgl.ai>

Expand Down
18 changes: 18 additions & 0 deletions hubconf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Entrypoints for Pytorch Hub."""
from __future__ import annotations

dependencies = ["torch", "matgl"]

import matgl # noqa


# resnet18 is the name of entrypoint
def m3gnet_universal_potential(version="MP-2021.2.8-DIRECT", **kwargs):
"""M3GNet Universal Potential model.
Args:
version (str): Defaults to "MP-2021.2.8-DIRECT". Other versions available.
**kwargs: Pass through to matgl.load_model.
"""
# Call the model, load pretrained weights
return matgl.load_model(f"M3GNet-{version}", **kwargs)

0 comments on commit 3b107f7

Please sign in to comment.