Skip to content

Commit e9720f7

Browse files
authored
fix example (#17)
1 parent 9e9b996 commit e9720f7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

_doc/examples/plot_export_tiny_llm_patched.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@
6363
"""
6464

6565
import copy
66+
import pprint
6667
import torch
6768
import transformers
69+
from onnx_diagnostic.helpers import string_type
6870
from onnx_diagnostic.torch_export_patches.onnx_export_errors import bypass_export_some_errors
6971
from onnx_diagnostic.torch_models.llms import get_tiny_llm
7072

@@ -78,6 +80,18 @@
7880

7981
cloned_inputs = copy.deepcopy(inputs)
8082

83+
# %%
84+
# Let's show this inputs, this was inferred in
85+
# example :ref:`l-plot-tiny-llm-export`.
86+
87+
print(string_type(inputs, with_shape=True))
88+
89+
# %%
90+
# And the dynamic shapes
91+
pprint.pprint(dynamic_shapes)
92+
93+
# %%
94+
# We are ready to export.
8195

8296
with bypass_export_some_errors(patch_transformers=True) as modificator:
8397
ep = torch.export.export(

0 commit comments

Comments
 (0)