pytorch / serve

Serve, optimize and scale PyTorch models in production
https://pytorch.org/serve/
Apache License 2.0
4.22k stars 863 forks source link

gRPC documentation doesn't match ts_scripts #2020

Open david-waterworth opened 1 year ago

david-waterworth commented 1 year ago

📚 The doc issue

The gRPC documentation appears to by out of sync with the codebase. The documentation for register states

python ts_scripts/torchserve_grpc_client.py register densenet161

But the ts_scripts/torchserve_grpc_client.py script expects two additional arguments for the register API (model_name and mar_set_str)

https://github.com/pytorch/serve/blob/8d877b0f75f4c9cd899ed02669b9278f019013a1/ts_scripts/torchserve_grpc_client.py#L86

So the script fails on line 86 - you need to pass a mar filename with no path, i.e.

python ts_scripts/torchserve_grpc_client.py register densenet161 densenet161.mar

It seems to be optional in the register method itself - but then there's a hardcoded reference to https://torchserve.s3.amazonaws.com/mar_files/{model_name}.mar

Suggest a potential alternative/fix

No response

msaroufim commented 1 year ago

This PR by @LuigiCerone was attempting to fix this https://github.com/pytorch/serve/pull/1994

hungtooc commented 1 year ago

and missing some grpc apis: