Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Oct 9, 2024
1 parent 39b940e commit 5642db2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions optimum/exporters/onnx/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ def export_pytorch(
FORCE_ONNX_EXTERNAL_DATA = os.getenv("FORCE_ONNX_EXTERNAL_DATA", "0") == "1"

model_kwargs = model_kwargs or {}
# num_logits_to_keep was added in transformers 4.45 and isn't added as inputs when exporting the model
if check_if_transformers_greater("4.44.99") and "num_logits_to_keep" in signature(model.forward).parameters.keys():
model_kwargs["num_logits_to_keep"] = 0

Expand Down

0 comments on commit 5642db2

Please sign in to comment.