Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /autonomi-ai_nos /tests /cli /test_cli_predict.py
| import pytest | |
| from typer.testing import CliRunner | |
| from nos.cli.cli import app_cli | |
| from nos.constants import DEFAULT_GRPC_HOST | |
| from nos.test.conftest import grpc_server_docker_runtime_cpu, grpc_server_docker_runtime_gpu # noqa: F401 | |
| from nos.test.utils import NOS_TEST_IMAGE | |
| pytestmark = pytest.mark.client | |
| runner = CliRunner() | |
| def test_cli_predict_help(): | |
| result = runner.invoke(app_cli, ["predict", "--help"]) | |
| assert result.exit_code == 0 | |
| def test_cli_predict_list(grpc_server_docker_runtime_gpu): # noqa: F811 | |
| from nos.test.conftest import GRPC_TEST_PORT_GPU | |
| result = runner.invoke(app_cli, ["predict", "-a", f"localhost:{GRPC_TEST_PORT_GPU}", "list"]) | |
| assert result.exit_code == 0 | |
| def test_cli_predict_txt2vec(grpc_server_docker_runtime_gpu): # noqa: F811 | |
| from nos.test.conftest import GRPC_TEST_PORT_GPU | |
| result = runner.invoke( | |
| app_cli, | |
| ["predict", "-a", f"{DEFAULT_GRPC_HOST}:{GRPC_TEST_PORT_GPU}", "txt2vec", "-i", "Nitrous Oxide System"], | |
| ) | |
| assert result.exit_code == 0 | |
| def test_cli_predict_img2vec(grpc_server_docker_runtime_gpu): # noqa: F811 | |
| from nos.test.conftest import GRPC_TEST_PORT_GPU | |
| result = runner.invoke( | |
| app_cli, ["predict", "-a", f"{DEFAULT_GRPC_HOST}:{GRPC_TEST_PORT_GPU}", "img2vec", "-i", NOS_TEST_IMAGE] | |
| ) | |
| assert result.exit_code == 0 | |
| def test_cli_predict_img2bbox(grpc_server_docker_runtime_gpu): # noqa: F811 | |
| from nos.test.conftest import GRPC_TEST_PORT_GPU | |
| result = runner.invoke( | |
| app_cli, ["predict", "-a", f"{DEFAULT_GRPC_HOST}:{GRPC_TEST_PORT_GPU}", "img2bbox", "-i", NOS_TEST_IMAGE] | |
| ) | |
| assert result.exit_code == 0 | |
| def test_cli_predict_txt2img(grpc_server_docker_runtime_gpu): # noqa: F811 | |
| from nos.test.conftest import GRPC_TEST_PORT_GPU | |
| result = runner.invoke( | |
| app_cli, | |
| ["predict", "-a", f"{DEFAULT_GRPC_HOST}:{GRPC_TEST_PORT_GPU}", "txt2img", "-i", "Nitrous Oxide System"], | |
| ) | |
| assert result.exit_code == 0 | |
| def test_cli_predict_segmentation(grpc_server_docker_runtime_gpu): # noqa: F811 | |
| from nos.test.conftest import GRPC_TEST_PORT_GPU | |
| result = runner.invoke( | |
| app_cli, ["predict", "-a", f"{DEFAULT_GRPC_HOST}:{GRPC_TEST_PORT_GPU}", "segmentation", "-i", NOS_TEST_IMAGE] | |
| ) | |
| assert result.exit_code == 0 | |
Xet Storage Details
- Size:
- 2.34 kB
- Xet hash:
- 27303d3770f0f71f2ecab789a362cc4f7a086cd7a6f5f5a2ddacba315d3e6494
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.