deepmd-kit icon indicating copy to clipboard operation
deepmd-kit copied to clipboard

Replace string search with API call in freeze function

Open coderabbitai[bot] opened this issue 1 year ago • 0 comments
trafficstars

In the function of , the model type is currently determined by searching for a string in . This method is not robust and could lead to errors if the string format changes. It is suggested to replace this string search with a dedicated API call that can more reliably determine the model type.

Affected code:

if '"type": "dpa2"' in model.model_def_script:

This issue was identified in PR https://github.com/deepmodeling/deepmd-kit/pull/3657 and discussed in the comments: https://github.com/deepmodeling/deepmd-kit/pull/3657#discussion_r1576909697

coderabbitai[bot] avatar Apr 26 '24 19:04 coderabbitai[bot]