FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Refactor demo code in "Configuring Model Bundles" so that it actually reuses bundle parameters · Pull Request #103 · scaleapi/launch-python-client · GitHub

Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 8 additions & 10 deletions docs/concepts/model_bundles.md
This file contains hidden or 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
Expand Up @@ -309,30 +309,28 @@ def my_load_model_fn(app_config):
return my_model_batched


BUNDLE_PARAMS_SINGLE = {
"model_bundle_name": "test-bundle-single",
BUNDLE_PARAMS_BASE = {
"load_predict_fn": my_load_predict_fn,
"load_model_fn": my_load_model_fn,
"requirements": ["pytest==7.2.1", "numpy"],
"request_schema": MyRequestSchema,
"response_schema": MyResponseSchema,
"pytorch_image_tag": "1.7.1-cuda11.0-cudnn8-runtime",
}

BUNDLE_PARAMS_SINGLE = {
"model_bundle_name": "test-bundle-single",
"app_config": {"mode": "single"},
}

BUNDLE_PARAMS_BATCHED = {
"model_bundle_name": "test-bundle-batched",
"load_predict_fn": my_load_predict_fn,
"load_model_fn": my_load_model_fn,
"requirements": ["pytest==7.2.1", "numpy"],
"request_schema": MyRequestSchema,
"response_schema": MyResponseSchema,
"pytorch_image_tag": "1.7.1-cuda11.0-cudnn8-runtime",
"app_config": {"mode": "batched"},
}

client = LaunchClient(api_key=os.getenv("LAUNCH_API_KEY"))
bundle_single = client.create_model_bundle_from_callable_v2(**BUNDLE_PARAMS_SINGLE)
bundle_batch = client.create_model_bundle_from_callable_v2(**BUNDLE_PARAMS_BATCHED)
bundle_single = client.create_model_bundle_from_callable_v2(**BUNDLE_PARAMS_BASE, **BUNDLE_PARAMS_SINGLE)
bundle_batch = client.create_model_bundle_from_callable_v2(**BUNDLE_PARAMS_BASE, **BUNDLE_PARAMS_BATCHED)
```

## Updating Model Bundles
Expand Down

Back | FazBrowse Home | New Git URL