Skip to content

Commit

Permalink
add check for with past
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Mar 17, 2024
1 parent 2b186f2 commit 8d2b6b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion optimum/exporters/openvino/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ def export_pytorch(
logger.info(f"Using framework PyTorch: {torch.__version__}")
output = Path(output)

if ensure_export_task_support_stateful(config.task):
task = config.task
if getattr(config, "use_past", False):
task += "-with-past"
if ensure_export_task_support_stateful(task):
# Trigger bettertransformer together with stateful model because OpenVINO HW-dependent transformations expect
# both of them are applied to demonstrate the best performance.
# TODO: Consider applying bettertransformer regardless of stateful flag -- requires additional validation.
Expand Down

0 comments on commit 8d2b6b7

Please sign in to comment.