Refactor demo code in "Configuring Model Bundles" so that it actually reuses bundle parameters · Pull Request #103 · scaleapi/launch-python-client · GitHub
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Summary
Refactor demo code in "Configuring Model Bundles" so that it actually reuses bundle parameters
Test Plan and Usage Guide
Preview from
Unit test:
(launch-python-client) 🚫➜ launch-python-client git:(update-Configuring-Model-Bundles-demo-code) poetry run pytest ================================================================= test session starts ================================================================= platform darwin -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0 rootdir: /Users/juitse.hung/Desktop/launch-python-client, configfile: pyproject.toml plugins: mock-3.10.0, requests-mock-1.10.0 collected 20 items tests/test_client.py::test_create_model_bundle_from_dirs_bundle_contents_correct -------------------------------------------------------------------- live log call -------------------------------------------------------------------- INFO launch.logger:connection.py:70 Make request to https://api.scale.com/v1/hosted_inference/model_bundle_upload INFO launch.logger:connection.py:80 API request has response code 200 INFO launch.client:client.py:984 create_model_bundle_from_dirs: raw_bundle_url=s3://my-fake-bucket/path/to/bundle PASSED [ 5%] tests/test_client.py::test_get_non_existent_model_endpoint PASSED [ 10%] tests/test_docs.py::test_docs_examples[docs/index.md:10-91] PASSED [ 15%] tests/test_docs.py::test_docs_examples[docs/guides/custom_docker_images.md:28-57] SKIPPED (test='skip' on code snippet) [ 20%] tests/test_docs.py::test_docs_examples[docs/guides/custom_docker_images.md:69-115] SKIPPED (test='skip' on code snippet) [ 25%] tests/test_docs.py::test_docs_examples[docs/concepts/callbacks.md:23-71] PASSED [ 30%] tests/test_docs.py::test_docs_examples[docs/concepts/callbacks.md:89-163] -------------------------------------------------------------------- live log call -------------------------------------------------------------------- INFO launch.client:client.py:1526 Editing existing endpoint INFO launch.client:client.py:1593 Endpoint edit task id is <MagicMock name='mock.get()' id='140619063548896'> PASSED [ 35%] tests/test_docs.py::test_docs_examples[docs/concepts/model_bundles.md:259-334] PASSED [ 40%] tests/test_docs.py::test_docs_examples[docs/concepts/batch_jobs.md:13-43] -------------------------------------------------------------------- live log call -------------------------------------------------------------------- INFO launch.client:client.py:2056 Writing batch task csv to s3://<MagicMock id='140619060276144'>/<MagicMock id='140619060276144'> INFO root:batch_jobs_13_43.py:40 the batch job is SUCCESS INFO root:batch_jobs_13_43.py:42 {'job_id': 'test-batch-job', 'status': 'SUCCESS'} PASSED [ 45%] tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:41-58] PASSED [ 50%] tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:67-84] PASSED [ 55%] tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:90-96] PASSED [ 60%] tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:98-107] -------------------------------------------------------------------- live log call -------------------------------------------------------------------- INFO launch.client:client.py:1526 Editing existing endpoint INFO launch.client:client.py:1593 Endpoint edit task id is <MagicMock name='mock.get()' id='140619063755632'> PASSED [ 65%] tests/test_docs.py::test_docs_examples[docs/concepts/model_endpoints.md:109-127] PASSED [ 70%] tests/test_import_lib.py::test_dummy PASSED [ 75%] tests/test_make_batch_file.py::test_make_batch_file PASSED [ 80%] tests/test_model_endpoint.py::test_status_returns_updated_value PASSED [ 85%] tests/test_pydantic_schemas.py::test_get_model_definitions PASSED [ 90%] tests/test_pydantic_schemas.py::test_get_model_definitions_from_flat_models PASSED [ 95%] tests/test_utils.py::test_trim_kwargs PASSED [100%] ================================================================== warnings summary =================================================================== tests/test_client.py::test_create_model_bundle_from_dirs_bundle_contents_correct /Users/juitse.hung/Desktop/launch-python-client/tests/test_client.py:71: DeprecatedWarning: create_model_bundle_from_dirs is deprecated as of 1.0.0. Use create_model_bundle_from_dirs_v2. client.create_model_bundle_from_dirs( tests/test_docs.py::test_docs_examples[docs/concepts/batch_jobs.md:13-43] /private/var/folders/7z/mq5w4kvj0tnf5km_vkbvwprh0000gq/T/pytest-of-juitse.hung/pytest-1/test_docs_examples_docs_concep3/batch_jobs_13_43.py:37: RuntimeWarning: coroutine 'test_docs_examples.<locals>.dont_sleep' was never awaited time.sleep(30) Enable tracemalloc to get traceback where the object was allocated. See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info. -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ====================================================== 18 passed, 2 skipped, 2 warnings in 1.03s ====================================================== (launch-python-client) 🚫➜ launch-python-client git:(update-Configuring-Model-Bundles-demo-code)Shortcut Ticket
N/A