Skip to content

Commit

Permalink
Add model bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
knc6 committed Oct 4, 2024
1 parent 2098f5f commit 8b6da9b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jarvis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Version number."""

__version__ = "2024.8.30"
__version__ = "2024.9.30"

import os

Expand Down
14 changes: 12 additions & 2 deletions jarvis/core/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,9 @@ def hook(model, input, output):

from alignn.graphs import Graph
from alignn.pretrained import get_figshare_model
import torch

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

g, lg = Graph.atom_dgl_multigraph(
self,
Expand All @@ -1452,6 +1455,8 @@ def hook(model, input, output):
model = get_figshare_model(
model_name="jv_formation_energy_peratom_alignn"
)
g.to(device)
lg.to(device)
h = get_val(model, g, lg)
return h

Expand Down Expand Up @@ -1571,11 +1576,15 @@ def describe(
cutoff=4,
take_n_bonds=2,
include_spg=True,
include_mineral_name=False,
):
"""Describe for NLP applications."""
from jarvis.analysis.diffraction.xrd import XRD

min_name = self.get_minaral_name()
if include_mineral_name:
min_name = self.get_minaral_name()
else:
min_name = "na"
if include_spg:
from jarvis.analysis.structure.spacegroup import Spacegroup3D

Expand Down Expand Up @@ -1713,7 +1722,8 @@ def describe(
+ struct_info["wyckoff"]
+ "."
)
if min_name is not None:
if min_name != "na":
# if min_name is not None:
line3 = (
chem_info["atomic_formula"]
+ " is "
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="jarvis-tools",
version="2024.8.30",
version="2024.9.30",
long_description=long_d,
install_requires=[
"numpy>=1.20.1",
Expand Down

0 comments on commit 8b6da9b

Please sign in to comment.