Skip to content

Commit acabcfd

Browse files
author
Han Wang
committed
fix(ci): restore pre-committed .pth files and handle missing custom ops
Restore deeppot_sea.pth and deeppot_dpa.pth to git tracking — CI cannot regenerate them because tabulate_fusion_se_t_tebd custom op is not available in the Python-only CI environment. Remove the dp convert-backend .pth lines from convert-models.sh. Add try/except around .pth export in gen_dpa1.py and gen_fparam_aparam.py so the scripts don't fail when custom ops are unavailable — only .pt2 generation is required.
1 parent 3d3fd09 commit acabcfd

5 files changed

Lines changed: 12 additions & 4 deletions

File tree

source/tests/infer/convert-models.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ set -ev
55
SCRIPT_PATH=$(dirname $(realpath -s $0))
66

77
dp convert-backend ${SCRIPT_PATH}/deeppot_sea.yaml ${SCRIPT_PATH}/deeppot_sea.savedmodel
8-
dp convert-backend ${SCRIPT_PATH}/deeppot_sea.yaml ${SCRIPT_PATH}/deeppot_sea.pth
98
dp convert-backend ${SCRIPT_PATH}/deeppot_dpa.yaml ${SCRIPT_PATH}/deeppot_dpa.savedmodel
10-
dp convert-backend ${SCRIPT_PATH}/deeppot_dpa.yaml ${SCRIPT_PATH}/deeppot_dpa.pth
119

1210
# Generate .pth and .pt2 model files for C++ tests
1311
python ${SCRIPT_PATH}/gen_dpa1.py

source/tests/infer/deeppot_dpa.pth

313 KB
Binary file not shown.

source/tests/infer/deeppot_sea.pth

140 KB
Binary file not shown.

source/tests/infer/gen_dpa1.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ def main():
103103

104104
pth_path = os.path.join(base_dir, "deeppot_dpa1.pth")
105105
print(f"Exporting to {pth_path} ...") # noqa: T201
106-
pt_deserialize_to_file(pth_path, copy.deepcopy(data))
106+
try:
107+
pt_deserialize_to_file(pth_path, copy.deepcopy(data))
108+
except RuntimeError as e:
109+
# Custom ops (e.g. tabulate_fusion_se_t_tebd) may not be available
110+
# in all build environments; .pth generation is not critical.
111+
print(f"WARNING: .pth export failed ({e}), skipping.") # noqa: T201
107112

108113
print("Export done.") # noqa: T201
109114

source/tests/infer/gen_fparam_aparam.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ def main():
8585

8686
pth_path = os.path.join(base_dir, "fparam_aparam.pth")
8787
print(f"Exporting to {pth_path} ...") # noqa: T201
88-
pt_deserialize_to_file(pth_path, copy.deepcopy(data))
88+
try:
89+
pt_deserialize_to_file(pth_path, copy.deepcopy(data))
90+
except RuntimeError as e:
91+
# Custom ops (e.g. tabulate_fusion_se_t_tebd) may not be available
92+
# in all build environments; .pth generation is not critical.
93+
print(f"WARNING: .pth export failed ({e}), skipping.") # noqa: T201
8994

9095
print("Export done.") # noqa: T201
9196

0 commit comments

Comments
 (0)