-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from Yoctol/use-grpclib
Use grpclib not aiorpc
- Loading branch information
Showing
30 changed files
with
1,744 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,5 +96,4 @@ dump.rdb | |
.vscode/ | ||
.pytest_cache/ | ||
|
||
**/*_pb2* | ||
.fake-models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generated by the Protocol Buffers compiler. DO NOT EDIT! | ||
# source: serving_utils/protos/list_models.proto | ||
# plugin: grpclib.plugin.main | ||
import abc | ||
|
||
import grpclib.const | ||
import grpclib.client | ||
|
||
import serving_utils.protos.list_models_pb2 | ||
|
||
|
||
class ListModelsBase(abc.ABC): | ||
|
||
@abc.abstractmethod | ||
async def ListModels(self, stream): | ||
pass | ||
|
||
def __mapping__(self): | ||
return { | ||
'/ListModels/ListModels': grpclib.const.Handler( | ||
self.ListModels, | ||
grpclib.const.Cardinality.UNARY_UNARY, | ||
serving_utils.protos.list_models_pb2.ListModelsRequest, | ||
serving_utils.protos.list_models_pb2.ListModelsResponse, | ||
), | ||
} | ||
|
||
|
||
class ListModelsStub: | ||
|
||
def __init__(self, channel: grpclib.client.Channel) -> None: | ||
self.ListModels = grpclib.client.UnaryUnaryMethod( | ||
channel, | ||
'/ListModels/ListModels', | ||
serving_utils.protos.list_models_pb2.ListModelsRequest, | ||
serving_utils.protos.list_models_pb2.ListModelsResponse, | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
import grpc | ||
|
||
from serving_utils.protos import list_models_pb2 as serving__utils_dot_protos_dot_list__models__pb2 | ||
|
||
|
||
class ListModelsStub(object): | ||
# missing associated documentation comment in .proto file | ||
pass | ||
|
||
def __init__(self, channel): | ||
"""Constructor. | ||
Args: | ||
channel: A grpc.Channel. | ||
""" | ||
self.ListModels = channel.unary_unary( | ||
'/ListModels/ListModels', | ||
request_serializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsRequest.SerializeToString, | ||
response_deserializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsResponse.FromString, | ||
) | ||
|
||
|
||
class ListModelsServicer(object): | ||
# missing associated documentation comment in .proto file | ||
pass | ||
|
||
def ListModels(self, request, context): | ||
# missing associated documentation comment in .proto file | ||
pass | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
|
||
def add_ListModelsServicer_to_server(servicer, server): | ||
rpc_method_handlers = { | ||
'ListModels': grpc.unary_unary_rpc_method_handler( | ||
servicer.ListModels, | ||
request_deserializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsRequest.FromString, | ||
response_serializer=serving__utils_dot_protos_dot_list__models__pb2.ListModelsResponse.SerializeToString, | ||
), | ||
} | ||
generic_handler = grpc.method_handlers_generic_handler( | ||
'ListModels', rpc_method_handlers) | ||
server.add_generic_rpc_handlers((generic_handler,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Generated by the Protocol Buffers compiler. DO NOT EDIT! | ||
# source: serving_utils/protos/model.proto | ||
# plugin: grpclib.plugin.main |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
import grpc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Generated by the Protocol Buffers compiler. DO NOT EDIT! | ||
# source: serving_utils/protos/predict.proto | ||
# plugin: grpclib.plugin.main |
Oops, something went wrong.