Skip to content

Commit

Permalink
Updated docstring and removed redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
mht-sharma committed Nov 22, 2022
1 parent 96cdd90 commit 28dc7d0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion optimum/exporters/onnx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def get_encoder_onnx_config(self, config: "PretrainedConfig"):

def get_decoder_onnx_config(self, config: "PretrainedConfig", task: str = "default", use_past: bool = False):
"""
Returns ONNX decoder config for `Seq2Seq` model. Implement the method to export the encoder
Returns ONNX decoder config for `Seq2Seq` models. Implement the method to export the decoder
of the model separately.
Args:
Expand Down
4 changes: 0 additions & 4 deletions optimum/utils/input_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,9 @@
if is_torch_available():
import torch

torch.manual_seed(0)

if is_tf_available():
import tensorflow as tf

tf.random.set_seed(0)


def check_framework_is_available(func):
@functools.wraps(func)
Expand Down
2 changes: 1 addition & 1 deletion tests/exporters/test_onnx_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def _onnx_export_for_encoder_decoder_models_for_ort(
decoder_onnx_config_with_past = onnx_config.get_decoder_onnx_config(
decoder_model.config, task.replace("-with-past", ""), use_past=True
)
models_for_export.extend([(model, decoder_onnx_config_with_past)])
models_for_export.append((model, decoder_onnx_config_with_past))

for model_to_export, model_onnx_config in models_for_export:
with NamedTemporaryFile("w") as output:
Expand Down

0 comments on commit 28dc7d0

Please sign in to comment.