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
8 changes: 7 additions & 1 deletion _doc/examples/plot_export_tiny_llm_dim01_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,13 @@ def validation(ep, input_sets, expected, catch_exception=True):
ep.model_proto.SerializeToString(), providers=["CPUExecutionProvider"]
)
for k, v in input_sets.items():
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
try:
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
except Exception as e:
if not catch_exception:
raise
yield k, e
continue
try:
got = sess.run(None, feeds)
except Exception as e:
Expand Down
8 changes: 7 additions & 1 deletion _doc/examples/plot_export_tiny_llm_dim01_onnx_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,13 @@ def validation(onx, input_sets, expected, catch_exception=True):
onx.SerializeToString(), providers=["CPUExecutionProvider"]
)
for k, v in input_sets.items():
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
try:
feeds = make_feeds(sess, torch_deepcopy(v), use_numpy=True)
except Exception as e:
if not catch_exception:
raise
yield k, e
continue
try:
got = sess.run(None, feeds)
except Exception as e:
Expand Down
4 changes: 2 additions & 2 deletions onnx_diagnostic/helpers/mini_onnx_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def _unflatten(
try:
return pos + 1, torch.from_numpy(outputs[pos]).to(device)
except TypeError:
# it shuold be more robusts
# it should be more robust
import ml_dtypes

if outputs[pos].dtype == ml_dtypes.bfloat16:
Expand Down Expand Up @@ -589,7 +589,7 @@ def create_input_tensors_from_onnx_model(

See example :ref:`l-plot-intermediate-results` for an example.

.. code-bloc:: python
.. code-block:: python

import os
from onnx_diagnostic.helpers.mini_onnx_builder import (
Expand Down
Loading