From 723ade95b11d8ba5011a4efe57846973079f9f05 Mon Sep 17 00:00:00 2001 From: Evaline Ju <69598118+evaline-ju@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:59:20 -0600 Subject: [PATCH] :rotating_light: Raise without else Signed-off-by: Evaline Ju <69598118+evaline-ju@users.noreply.github.com> --- caikit_nlp/toolkit/text_generation/tgis_utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/caikit_nlp/toolkit/text_generation/tgis_utils.py b/caikit_nlp/toolkit/text_generation/tgis_utils.py index 724773ed..d8988ce7 100644 --- a/caikit_nlp/toolkit/text_generation/tgis_utils.py +++ b/caikit_nlp/toolkit/text_generation/tgis_utils.py @@ -485,8 +485,7 @@ def unary_generate( raise CaikitCoreException( caikit_status_code, INACTIVE_RPC_CONN_ERR_MESSAGE ) from err - else: - raise CaikitCoreException(caikit_status_code, details) from err + raise CaikitCoreException(caikit_status_code, details) from err except grpc.RpcError as err: raise_caikit_core_exception(err) @@ -676,8 +675,7 @@ def stream_generate( raise CaikitCoreException( caikit_status_code, INACTIVE_RPC_CONN_ERR_MESSAGE ) from err - else: - raise CaikitCoreException(caikit_status_code, details) from err + raise CaikitCoreException(caikit_status_code, details) from err except grpc.RpcError as err: raise_caikit_core_exception(err)