From f7a7dabb721ce19406d0d29c63a40763f79c0ef4 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Tue, 9 Jul 2024 19:18:36 +0200 Subject: [PATCH] test --- src/transformers/trainer_seq2seq.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/transformers/trainer_seq2seq.py b/src/transformers/trainer_seq2seq.py index eedd67e24f4159..ca64eb4f08ac3a 100644 --- a/src/transformers/trainer_seq2seq.py +++ b/src/transformers/trainer_seq2seq.py @@ -111,11 +111,11 @@ def load_generation_config(gen_config_arg: Union[str, GenerationConfig]) -> Gene # Strict validation to fail early. `GenerationConfig.save_pretrained()`, run at the end of training, throws # an exception if there are warnings at validation time. - try: - with warnings.catch_warnings(record=True) as caught_warnings: - gen_config.validate() - if len(caught_warnings) == 0: - raise ValueError("Hello") + + with warnings.catch_warnings(record=True) as caught_warnings: + gen_config.validate() + if len(caught_warnings) == 0: + raise ValueError("Hello") return gen_config def evaluate(