Skip to content

Commit

Permalink
Update multi_task.py
Browse files Browse the repository at this point in the history
  • Loading branch information
iProzd committed Mar 5, 2024
1 parent 8376830 commit 37c6330
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deepmd/pt/utils/multi_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ def replace_one_item(params_dict, key_type, key_in_dict, suffix="", index=None):
)
for shared_key in shared_links:
shared_links[shared_key]["links"] = sorted(
shared_links[shared_key]["links"], key=lambda x: x["shared_level"]
shared_links[shared_key]["links"],
key=lambda x: x["shared_level"]
- ("spin" in model_config["model_dict"][x["model_key"]]) * 100,
)
# little trick to make spin models in the front to be the base models,
# because its type embeddings are more general.
assert len(type_map_keys) == 1, "Multitask model must have only one type_map!"
return model_config, shared_links

Expand Down

0 comments on commit 37c6330

Please sign in to comment.