Skip to content

Commit b42e9ac

Browse files
committed
+ test
1 parent cd9f090 commit b42e9ac

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/litmodels/io/gateway.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def upload_model(
2121
progress_bar: bool = True,
2222
cluster_id: Optional[str] = None,
2323
staging_dir: Optional[str] = None,
24+
verbose: Union[bool, int] = 0,
2425
) -> UploadedModelInfo:
2526
"""Upload a checkpoint to the model store.
2627
@@ -33,6 +34,7 @@ def upload_model(
3334
automatically.
3435
staging_dir: A directory where the model can be saved temporarily. If not provided, a temporary directory will
3536
be created and used.
37+
verbose: Whether to print some additional information about the uploaded model.
3638
3739
"""
3840
if not staging_dir:
@@ -54,6 +56,7 @@ def upload_model(
5456
name=name,
5557
progress_bar=progress_bar,
5658
cluster_id=cluster_id,
59+
verbose=verbose,
5760
)
5861

5962

tests/test_io_cloud.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_wrong_model_name(name):
2323
(Module(), f"%s{os.path.sep}Module.pth", True),
2424
],
2525
)
26-
def test_upload_model(mocker, tmpdir, model, model_path):
26+
def test_upload_model(mocker, tmpdir, model, model_path, verbose):
2727
# mocking the _get_teamspace to return another mock
2828
ts_mock = mock.MagicMock()
2929
mocker.patch("litmodels.io.cloud._get_teamspace", return_value=ts_mock)
@@ -34,6 +34,7 @@ def test_upload_model(mocker, tmpdir, model, model_path):
3434
name="org-name/teamspace/model-name",
3535
cluster_id="cluster_id",
3636
staging_dir=tmpdir,
37+
verbose=verbose,
3738
)
3839
expected_path = model_path % str(tmpdir) if "%" in model_path else model_path
3940
ts_mock.upload_model.assert_called_once_with(

0 commit comments

Comments
 (0)