From b08230354e6258bce8a2ea7753404c7b3f2d105b Mon Sep 17 00:00:00 2001 From: leaderofARS Date: Thu, 4 Dec 2025 17:56:42 +0530 Subject: [PATCH] Remove redundant else in activations to simplify control flow --- src/transformers/activations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/activations.py b/src/transformers/activations.py index 08a30b3dd88c..1312bede777e 100644 --- a/src/transformers/activations.py +++ b/src/transformers/activations.py @@ -345,8 +345,8 @@ def forward(self, input: Tensor) -> Tensor: def get_activation(activation_string): if activation_string in ACT2FN: return ACT2FN[activation_string] - else: - raise KeyError(f"function {activation_string} not found in ACT2FN mapping {list(ACT2FN.keys())}") + + raise KeyError(f"function {activation_string} not found in ACT2FN mapping {list(ACT2FN.keys())}") # For backwards compatibility with: from activations import gelu_python