Skip to content

Commit

Permalink
Fix the onnx export custom model example (#2203)
Browse files Browse the repository at this point in the history
fix the export custom model example; fix repo name; fix opset version;
  • Loading branch information
janak2 authored Mar 3, 2025
1 parent 99bc877 commit efe311c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/source/exporters/onnx/usage_guides/export_a_model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,13 @@ class CustomMPTOnnxConfig(TextDecoderOnnxConfig):
inputs_or_outputs[f"{name}.{i}.value"] = {0: "batch_size", 2: decoder_sequence_name}


model_id = "/home/fxmarty/hf_internship/optimum/tiny-mpt-random-remote-code"
model_id = "fxmarty/tiny-mpt-random-remote-code"
config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)

onnx_config = CustomMPTOnnxConfig(
config=config,
task="text-generation",
use_past_in_inputs=False,
use_present_in_outputs=True,
)
onnx_config_with_past = CustomMPTOnnxConfig(config, task="text-generation", use_past=True)

Expand All @@ -419,6 +418,8 @@ main_export(
trust_remote_code=True,
custom_onnx_configs=custom_onnx_configs,
no_post_process=True,
legacy=True,
opset=14
)
```

Expand Down

0 comments on commit efe311c

Please sign in to comment.