I generated a yaml file using the below command
serve build app:app -o config.yaml
In the yaml file I changed the route prefix. Now it looks something like this
applications:
- name: PredictionServer
route_prefix: /predict
import_path: app:app
runtime_env: {}
deployments:
- name: ModelServer
user_config:
engine: hf
model_path: "path-to-hf-model"
The problem here is my endpoint is available both on 127.0.0.1:8000/predict
as well as 127.0.0.1:8000/
. Why is it serving with 2 endpoints when I have specified only one in the yaml file? Is there something that needs to be corrected on my side.
This is the code in my file
import ray
from ray import serve
from starlette.requests import Request
@serve.deployment
class ModelServer:
def __init__(self):
self.dummy_response = "Hello world"
async def __call__(self, request: Request) -> str:
return "Hello world"
app = ModelServer.bind()
Any help is appreciated.