Skip to content

Commit

Permalink
add support for benchmark.yaml (#415)
Browse files Browse the repository at this point in the history
* add support for benchmark.yaml

recent zoo models use `benchmark.yaml` instead of `benchmarks.yaml`. adding this additional pathway so `benchmark.yaml` is downloaded in the bulk model download

* update files filter

* fix tests

---------

Co-authored-by: dbogunowicz <damian@neuralmagic.com>
  • Loading branch information
bfineran and dbogunowicz committed Feb 5, 2024
1 parent 17766cd commit 94e2ba8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sparsezoo/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def __init__(self, source: str, download_path: Optional[str] = None):
self.benchmarks: File = self._file_from_files(
files, display_name="benchmarks.yaml"
)
self.benchmark: File = self._file_from_files(
files, display_name="benchmark.yaml"
)
self.eval_results: File = self._file_from_files(files, display_name="eval.yaml")

# plaintext validation metrics optionally parsed from a zoo stub
Expand Down Expand Up @@ -243,6 +246,7 @@ def __init__(self, source: str, download_path: Optional[str] = None):
"onnx_model": self.onnx_model,
"analysis": self.analysis,
"benchmarks": self.benchmarks,
"benchmark": self.benchmark,
"eval_results": self.eval_results,
}

Expand Down
1 change: 1 addition & 0 deletions src/sparsezoo/model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"benchmarking",
"outputs",
"onnx_gz",
"benchmark",
}

_LOGGER = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions tests/sparsezoo/model/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"sample-labels",
"sample-outputs",
"benchmarks.yaml",
"benchmark.yaml",
"eval.yaml",
"analysis.yaml",
"model.md",
Expand Down

0 comments on commit 94e2ba8

Please sign in to comment.