Ray Serve Deployment 1.x to Ray 2 with options

In ray 1.1x, I was doing something along the lines of:

model_args = (“param1”, 2, “param3”)
model_id = “my model name”
MyModel.options(init_args=model_args, num_replicas=1, name=model_id).deploy()

How would I do the same in Ray 2.0? (BTW, the above works with Ray 2.0, but it’s my understanding that deploy will be deprecated.

Thx

Instead of

model_args = (“param1”, 2, “param3”)
model_id = “my model name”
MyModel.options(init_args=model_args, num_replicas=1, name=model_id).deploy()

You can do

serve.run(MyModel.options(num_replicas=1, name=model_id).bind(*model_args))
1 Like