transformers
ffae066d - Route chat management calls to the service root (#47138) (#47303)

Commit
123 days ago
Route chat management calls to the service root (#47138) (#47303) * Route chat management calls to the service root (#47138) transformers chat reuses base_url for the serve management endpoints, so with the documented base_url ending in /v1 the health check requests /v1/health and model loading posts to /v1/load_model. The serve app mounts /health, /load_model and /reset at the service root; only the OpenAI-compatible inference API lives under /v1. Derive the management base url by stripping a trailing /v1 segment and use it for check_health and print_model_load, while the AsyncInferenceClient keeps the full base_url. A base_url without /v1 is unchanged, and a /v1 under a reverse-proxy prefix keeps the prefix. Signed-off-by: Dhruv Sharma <dhruv7477@gmail.com> * Address review: rename helper to get_service_root_url, drop mocked tests Signed-off-by: Dhruv Sharma <dhruv7477@gmail.com> * Build the service root url with urlunparse instead of ParseResult._replace Signed-off-by: Dhruv Sharma <dhruv7477@gmail.com> --------- Signed-off-by: Dhruv Sharma <dhruv7477@gmail.com>
Author
Parents
Loading