[gRPC] Preserve original ImportError in grpc_server.py (#21801)
Signed-off-by: Chang Su <chang.s.su@oracle.com>
This commit is contained in:
@@ -7,9 +7,11 @@ async def serve_grpc(server_args, model_info=None):
|
|||||||
"""Start the standalone gRPC server with integrated scheduler."""
|
"""Start the standalone gRPC server with integrated scheduler."""
|
||||||
try:
|
try:
|
||||||
from smg_grpc_servicer.sglang.server import serve_grpc as _serve_grpc
|
from smg_grpc_servicer.sglang.server import serve_grpc as _serve_grpc
|
||||||
except ImportError:
|
except ImportError as e:
|
||||||
raise ImportError(
|
raise ImportError(
|
||||||
"gRPC mode requires the smg-grpc-servicer package. "
|
"gRPC mode requires the smg-grpc-servicer package. "
|
||||||
"Install it with: pip install smg-grpc-servicer[sglang]"
|
"If not installed, run: pip install smg-grpc-servicer[sglang]. "
|
||||||
) from None
|
"If already installed, there may be a broken import due to a "
|
||||||
|
"version mismatch — see the chained exception above for details."
|
||||||
|
) from e
|
||||||
await _serve_grpc(server_args, model_info)
|
await _serve_grpc(server_args, model_info)
|
||||||
|
|||||||
Reference in New Issue
Block a user