()
| 63 | |
| 64 | @pytest.mark.asyncio |
| 65 | async def test_simple_pytorch_api_without_server(): |
| 66 | api = ls.test_examples.SimpleTorchAPI() |
| 67 | api.setup("cpu") |
| 68 | assert api.model is not None, "Model should be loaded after setup" |
| 69 | assert isinstance(api.model, torch.nn.Module) |
| 70 | assert api.decode_request({"input": 4}) == 4, "Request should be decoded" |
| 71 | assert api.predict(torch.Tensor([4])).cpu() == 9, "Model should be able to predict" |
| 72 | assert api.encode_response(9) == {"output": 9}, "Response should be encoded" |
| 73 | |
| 74 | |
| 75 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected
searching dependent graphs…