Created
September 17, 2020 21:06
-
-
Save simon-mo/ba00b0cfcd968aa9b556a7dadfb00cb4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import ray | |
| from ray import serve | |
| ray.init(address="auto", ignore_reinit_error=True) | |
| client = serve.connect() | |
| client.create_backend("pytorch_backend", PyTorchBackend) | |
| client.set_traffic("sentiment_endpoint", {"pytorch_backend": 1.0}) |
This file contains hidden or 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
| import ray | |
| from ray import serve | |
| # Connect to the running Ray Serve instance. | |
| ray.init(address='auto', ignore_reinit_error=True) | |
| client = serve.connect() | |
| # Deploy the model. | |
| client.create_backend("sklearn_backend", SKLearnBackend) | |
| client.create_endpoint("sentiment_endpoint", backend="sklearn_backend", route="/sentiment") | |
This file contains hidden or 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
| import ray | |
| from ray import serve | |
| ray.init(address='auto') # Connect to the running Ray cluster. | |
| serve.start(detached=True) # Start the Ray Serve processes within the Ray cluster. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment