-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open browser to fastapi docs page when running model_serve (#54)
* open browser * add serving test basic * add option to automatically open browser
- Loading branch information
Showing
3 changed files
with
48 additions
and
389 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from ray import serve | ||
|
||
from xinfer.serve import serve_model | ||
|
||
|
||
def test_serve_model(): | ||
serve_model("vikhyatk/moondream2", blocking=False, open_api_docs=False) | ||
|
||
serve.shutdown() | ||
|
||
|
||
def test_serve_model_custom_deployment(): | ||
"""Test model serving with custom deployment options""" | ||
deployment_kwargs = {"num_replicas": 2, "ray_actor_options": {"num_cpus": 2}} | ||
handle = serve_model( | ||
"vikhyatk/moondream2", | ||
deployment_kwargs=deployment_kwargs, | ||
blocking=False, | ||
open_api_docs=False, | ||
) | ||
assert handle.deployment_id.name == "XInferModel" | ||
serve.shutdown() |
This file contains 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