diff --git a/optimum/onnxruntime/trainer_seq2seq.py b/optimum/onnxruntime/trainer_seq2seq.py index 7e6a67a3bba..0a2938802d2 100644 --- a/optimum/onnxruntime/trainer_seq2seq.py +++ b/optimum/onnxruntime/trainer_seq2seq.py @@ -51,6 +51,10 @@ if is_accelerate_available(): from accelerate import __version__ as accelerate_version +else: + raise ImportError( + "The package `accelerate` is required to use the ORTTrainer. Please install it following https://huggingface.co/docs/accelerate/basic_tutorials/install." + ) logger = logging.get_logger(__name__)