Skip to content

Commit

Permalink
fixed use_device in calculator init
Browse files Browse the repository at this point in the history
  • Loading branch information
bowen-bd committed Jul 24, 2024
1 parent 9556c3e commit 6f7b035
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion chgnet/model/dynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def __init__(
self.device = device

# Move the model to the specified device
self.model = (model or CHGNet.load(verbose=False)).to(self.device)
if model is None:
self.model = CHGNet.load(verbose=False, use_device=self.device)
else:
self.model = model.to(self.device)
self.model.graph_converter.set_isolated_atom_response(on_isolated_atoms)
self.stress_weight = stress_weight
print(f"CHGNet will run on {self.device}")
Expand Down

0 comments on commit 6f7b035

Please sign in to comment.