Skip to content

Commit f79642a

Browse files
committed
add more comments
1 parent 3bc484c commit f79642a

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

_doc/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ def linkcode_resolve(domain, info):
146146
("py:class", "transformers.cache_utils.EncoderDecoderCache"),
147147
("py:class", "transformers.cache_utils.HybridCache"),
148148
("py:class", "transformers.cache_utils.MambaCache"),
149-
("py:class", "transformers.models.mamba.modeling_mamba.MambaCache"),
150149
("py:class", "transformers.cache_utils.SlidingWindowCache"),
151150
("py:class", "transformers.cache_utils.StaticCache"),
152151
("py:class", "transformers.configuration_utils.PretrainedConfig"),
152+
("py:class", "transformers.configuration_utils.PreTrainedConfig"),
153153
("py:class", "transformers.modeling_outputs.BaseModelOutput"),
154+
("py:class", "transformers.models.mamba.modeling_mamba.MambaCache"),
154155
("py:class", "transformers.models.phi3.modeling_phi3.Phi3RotaryEmbedding"),
155156
("py:func", "torch.export._draft_export.draft_export"),
156157
("py:func", "torch._export.tools.report_exportability"),

_doc/examples/plot_export_tiny_llm_dim01.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
data = get_untrained_model_with_inputs("arnir0/Tiny-LLM", add_second_input=True)
3535
model, dynamic_shapes = data["model"], data["dynamic_shapes"]
3636

37+
# %%
38+
# The trained model can be obtained with:
39+
#
40+
# .. code-block:: python
41+
#
42+
# MODEL_NAME = "arnir0/Tiny-LLM"
43+
# tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME)
44+
# model = transformers.AutoModelForCausalLM.from_pretrained(MODEL_NAME)
45+
3746
input_sets = {k: v for k, v in data.items() if k.startswith("inputs")}
3847

3948
for k, v in input_sets.items():
@@ -207,6 +216,6 @@ def validation(ep, input_sets, expected):
207216

208217
# %%
209218
# If you have any error, then look at example
210-
# :ref:`l-plot-tiny-llm-export-cache_patched`.
219+
# :ref:`l-plot-tiny-llm-export-patched`.
211220

212221
doc.plot_legend("Tiny-LLM\nexport with\ndimension in {0,1}", "torch.export.export", "tomato")

_doc/examples/plot_export_tiny_llm_dim01_onnx.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
data = get_untrained_model_with_inputs("arnir0/Tiny-LLM", add_second_input=True)
3535
model, dynamic_shapes = data["model"], data["dynamic_shapes"]
3636

37+
# %%
38+
# The trained model can be obtained with:
39+
#
40+
# .. code-block:: python
41+
#
42+
# MODEL_NAME = "arnir0/Tiny-LLM"
43+
# tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME)
44+
# model = transformers.AutoModelForCausalLM.from_pretrained(MODEL_NAME)
45+
3746
input_sets = {k: v for k, v in data.items() if k.startswith("inputs")}
3847

3948
for k, v in input_sets.items():
@@ -221,6 +230,6 @@ def validation(ep, input_sets, expected, catch_exception=True):
221230

222231
# %%
223232
# If you have any error, then look at example
224-
# :ref:`l-plot-tiny-llm-export-cache_patched`.
233+
# :ref:`l-plot-tiny-llm-export-patched`.
225234

226235
doc.plot_legend("Tiny-LLM\nexport with\ndimension in {0,1}", "torch.onnx.export", "tomato")

_doc/examples/plot_export_tiny_llm_dim01_onnx_custom.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
data = get_untrained_model_with_inputs("arnir0/Tiny-LLM", add_second_input=True)
3434
model, dynamic_shapes = data["model"], data["dynamic_shapes"]
3535

36+
# %%
37+
# The trained model can be obtained with:
38+
#
39+
# .. code-block:: python
40+
#
41+
# MODEL_NAME = "arnir0/Tiny-LLM"
42+
# tokenizer = transformers.AutoTokenizer.from_pretrained(MODEL_NAME)
43+
# model = transformers.AutoModelForCausalLM.from_pretrained(MODEL_NAME)
44+
3645
input_sets = {k: v for k, v in data.items() if k.startswith("inputs")}
3746

3847
for k, v in input_sets.items():
@@ -219,6 +228,6 @@ def validation(onx, input_sets, expected, catch_exception=True):
219228

220229
# %%
221230
# If you have any error, then look at example
222-
# :ref:`l-plot-tiny-llm-export-cache_patched`.
231+
# :ref:`l-plot-tiny-llm-export-patched`.
223232

224233
doc.plot_legend("Tiny-LLM\nexport with\ndimension in {0,1}", "to_onnx", "tomato")

0 commit comments

Comments
 (0)