mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[Doc] [Serve] Fix README's quick_start and add to test suite (#22228)
This commit is contained in:
parent
54a71e6c4f
commit
293e45c527
3 changed files with 14 additions and 2 deletions
5
doc/source/serve/_examples/doc_code/BUILD
Normal file
5
doc/source/serve/_examples/doc_code/BUILD
Normal file
|
@ -0,0 +1,5 @@
|
|||
py_library(
|
||||
name = "serve_doc_code",
|
||||
srcs = glob(["**/*.py"]),
|
||||
visibility = ["//python/ray/serve:__subpackages__", "//python/ray/serve:__pkg__"],
|
||||
)
|
|
@ -24,8 +24,8 @@ class BoostingModel:
|
|||
self.label_list = iris_dataset["target_names"].tolist()
|
||||
|
||||
async def __call__(self, request):
|
||||
payload = await request.json()["vector"]
|
||||
print(f"Received flask request with data {payload}")
|
||||
payload = (await request.json())["vector"]
|
||||
print(f"Received http request with data {payload}")
|
||||
|
||||
prediction = self.model.predict([payload])[0]
|
||||
human_name = self.label_list[prediction]
|
||||
|
|
|
@ -340,6 +340,13 @@ py_test(
|
|||
deps = [":serve_lib"]
|
||||
)
|
||||
|
||||
py_test(
|
||||
name = "tutorial_sklearn_ray_overview",
|
||||
size = "small",
|
||||
main = "quick_start.py",
|
||||
srcs = ["//doc/source/serve/_examples/doc_code:serve_doc_code"],
|
||||
tags = ["exclusive", "team:serve"],
|
||||
)
|
||||
|
||||
py_test(
|
||||
name = "tutorial_rllib",
|
||||
|
|
Loading…
Add table
Reference in a new issue