Skip to content

Commit

Permalink
Fix modelzoo test failure due to complete restructuring of modelzoo r…
Browse files Browse the repository at this point in the history
…epo (onnx#2663)

Signed-off-by: Gong Su <[email protected]>
  • Loading branch information
gongsu832 authored Dec 18, 2023
1 parent df5eed9 commit 2b28773
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions utils/RunONNXModelZoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@

"""Commands will be called in this script.
"""
FIND_MODEL_PATHS_CMD = ["find", ".", "-type", "f", "-name", "*.tar.gz"]

# modelzoo has been completely restructured and the original models are now under
# the "archive" directory. We could check all the new models as well but that
# would take very long (about 6 hours on the Jenkins CI) so we still only check
# the original models under "archive".
FIND_MODEL_PATHS_CMD = ["find", "archive", "-type", "f", "-name", "*.tar.gz"]
GIT_CMD = ["git"]
# Use curl instead of wget since most systems have curl preinstalled
# and curl is more flexible than wget
Expand Down Expand Up @@ -293,8 +298,10 @@ def clone_modelzoo_source(repo_url, work_dir):
def obtain_all_model_paths(repo_dir):
_, model_paths = execute_commands(FIND_MODEL_PATHS_CMD, cwd=repo_dir)
model_paths = model_paths.split("\n")
# Remove empty paths and prune '._' in a path.
model_paths = [path[2:] for path in model_paths if path]
# Remove empty paths and prune './' in a path.
model_paths = [
(path[2:] if path.startswith("./") else path) for path in model_paths if path
]
model_names = [
path.split("/")[-1][: -len(".tar.gz")] for path in model_paths
] # remove .tar.gz
Expand Down

0 comments on commit 2b28773

Please sign in to comment.