Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: caikit/caikit-nlp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.5.0
Choose a base ref
...
head repository: caikit/caikit-nlp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.5.1
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Aug 2, 2024

  1. 🥅 Catch InactiveError for TGIS to modify error message

    Signed-off-by: gkumbhat <kumbhat.gaurav@gmail.com>
    gkumbhat committed Aug 2, 2024
    Copy the full SHA
    226d7b8 View commit details
  2. 🔧 Move err message to const as per review suggestion

    Signed-off-by: gkumbhat <kumbhat.gaurav@gmail.com>
    gkumbhat committed Aug 2, 2024
    Copy the full SHA
    d6adb79 View commit details
  3. Merge pull request #372 from gkumbhat/add_tgis_inactive_error

    🥅 Catch InactiveError for TGIS to modify error message
    gkumbhat authored Aug 2, 2024
    Copy the full SHA
    79ac58e View commit details
Showing with 17 additions and 0 deletions.
  1. +17 −0 caikit_nlp/toolkit/text_generation/tgis_utils.py
17 changes: 17 additions & 0 deletions caikit_nlp/toolkit/text_generation/tgis_utils.py
Original file line number Diff line number Diff line change
@@ -91,6 +91,7 @@
# HTTP Header / gRPC Metadata key used to identify a route override
# (forwarded for API compatibility)
ROUTE_INFO_HEADER_KEY = TGISBackend.ROUTE_INFO_HEADER_KEY
INACTIVE_RPC_CONN_ERR_MESSAGE = "The underlying TCP connection is closed"
get_route_info = TGISBackend.get_route_info


@@ -474,6 +475,14 @@ def unary_generate(
batch_response = self.tgis_client.Generate(
request, timeout=self.tgis_req_timeout
)
except grpc._channel._InactiveRpcError as err:
log.error("<NLP30829218E>", err.details)
caikit_status_code = GRPC_TO_CAIKIT_CORE_STATUS.get(
err.code(), CaikitCoreStatusCode.UNKNOWN
)
raise CaikitCoreException(
caikit_status_code, INACTIVE_RPC_CONN_ERR_MESSAGE
) from err
except grpc.RpcError as err:
raise_caikit_core_exception(err)

@@ -653,6 +662,14 @@ def stream_generate(
input_tokens=input_token_list,
details=details,
)
except grpc._channel._InactiveRpcError as err:
log.error("<NLP11829118E>", err.details)
caikit_status_code = GRPC_TO_CAIKIT_CORE_STATUS.get(
err.code(), CaikitCoreStatusCode.UNKNOWN
)
raise CaikitCoreException(
caikit_status_code, INACTIVE_RPC_CONN_ERR_MESSAGE
) from err
except grpc.RpcError as err:
raise_caikit_core_exception(err)