Skip to content

Commit

Permalink
fix slicing error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi-FanLi committed Oct 23, 2023
1 parent 9bcb215 commit ef61957
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepmd/entrypoints/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def convert(
output_model: str,
**kwargs,
):
if output_model[:-6] == ".pbtxt":
if input_model[:-6] != ".pbtxt":
if output_model[-6:] == ".pbtxt":
if input_model[-6:] != ".pbtxt":
convert_pb_to_pbtxt(input_model, output_model)

Check warning on line 23 in deepmd/entrypoints/convert.py

View check run for this annotation

Codecov / codecov/patch

deepmd/entrypoints/convert.py#L21-L23

Added lines #L21 - L23 were not covered by tests
else:
raise RuntimeError("input model is already pbtx")

Check warning on line 25 in deepmd/entrypoints/convert.py

View check run for this annotation

Codecov / codecov/patch

deepmd/entrypoints/convert.py#L25

Added line #L25 was not covered by tests
Expand Down

0 comments on commit ef61957

Please sign in to comment.