Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix PyTorch model extension in simplify #1596

Merged
merged 4 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dpgen/simplify/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ def run_model_devi(iter_index, jdata, mdata):
commands = []
run_tasks = ["."]
# get models
models = glob.glob(os.path.join(work_path, "graph*pb"))
suffix = _get_model_suffix(jdata)
models = glob.glob(os.path.join(work_path, f"graph*{suffix}"))
assert len(models) > 0, "No model file found."
model_names = [os.path.basename(ii) for ii in models]
task_model_list = []
for ii in model_names:
Expand Down
3 changes: 3 additions & 0 deletions tests/simplify/test_run_model_devi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class TestOneH5(unittest.TestCase):
def setUp(self):
work_path = Path("iter.000000") / "01.model_devi"
work_path.mkdir(parents=True, exist_ok=True)
# fake models
for ii in range(4):
(work_path / f"graph.{ii:03d}.pb").touch()
with tempfile.TemporaryDirectory() as tmpdir:
with open(Path(tmpdir) / "test.xyz", "w") as f:
f.write(
Expand Down