Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOGS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Change Logs
0.7.11
++++++

* :pr:`224`: support model_id with // to specify a subfolder
* :pr:`223`: adds task image-to-video
* :pr:`220`: adds option --ort-logs to display onnxruntime logs when creating the session
* :pr:`220`: adds a patch for PR `#40791 <https://github.com/huggingface/transformers/pull/40791>`_ in transformers
Expand Down
11 changes: 11 additions & 0 deletions onnx_diagnostic/torch_models/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,16 @@ def shrink_config(cfg: Dict[str, Any]) -> Dict[str, Any]:
return new_cfg


def _preprocess_model_id(model_id, subfolder):
if subfolder or "//" not in model_id:
return model_id, subfolder
spl = model_id.split("//")
if spl[-1] in {"transformer", "vae"}:
# known subfolder
return "//".join(spl[:-1]), spl[-1]
return model_id, subfolder


def validate_model(
model_id: str,
task: Optional[str] = None,
Expand Down Expand Up @@ -374,6 +384,7 @@ def validate_model(
if ``runtime == 'ref'``,
``orteval10`` increases the verbosity.
"""
model_id, subfolder = _preprocess_model_id(model_id, subfolder)
if isinstance(patch, bool):
patch_kwargs = (
dict(patch_transformers=True, patch_diffusers=True, patch=True)
Expand Down
Loading