Skip to content

Commit

Permalink
update log information
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghan234 committed Dec 5, 2024
1 parent 1341776 commit d90ea45
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/mattersim/forcefield/potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"""
Potential
"""
import logging
import os
import pickle
import random
Expand All @@ -19,6 +18,7 @@
from ase.constraints import full_3x3_to_voigt_6_stress
from ase.units import GPa
from deprecated import deprecated
from loguru import logger
from torch.optim import Adam
from torch.optim.lr_scheduler import ReduceLROnPlateau, StepLR
from torch_ema import ExponentialMovingAverage
Expand All @@ -32,14 +32,6 @@

rank = int(os.getenv("RANK", 0))

if rank == 0:
logging.basicConfig(
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
)
else:
logging.basicConfig(level=logging.CRITICAL)
logger = logging.getLogger(__name__)


@compile_mode("script")
class Potential(nn.Module):
Expand Down Expand Up @@ -873,6 +865,10 @@ def from_checkpoint(
):
load_path = os.path.join(checkpoint_folder, "mattersim-v1.0.0-1M.pth")
if not os.path.exists(load_path):
logger.info(
"The pre-trained model is not found locally, "
"attempting to download it from the server."
)
download_checkpoint(
"mattersim-v1.0.0-1M.pth", save_folder=checkpoint_folder
)
Expand All @@ -883,6 +879,10 @@ def from_checkpoint(
):
load_path = os.path.join(checkpoint_folder, "mattersim-v1.0.0-5M.pth")
if not os.path.exists(load_path):
logger.info(
"The pre-trained model is not found locally, "
"attempting to download it from the server."
)
download_checkpoint(
"mattersim-v1.0.0-5M.pth", save_folder=checkpoint_folder
)
Expand Down

0 comments on commit d90ea45

Please sign in to comment.