Spaces:
Sleeping
Sleeping
Download tests/test_inference.py from vorddd/GSLC-MLOps: direct link, hf CLI and curl.
- Browser
- Download file 283 Bytes
-
https://huggingface.co/spaces/vorddd/GSLC-MLOps/resolve/main/tests/test_inference.py
- Command line
-
hf download hf://spaces/vorddd/GSLC-MLOps/tests/test_inference.py
-
curl -L -o test_inference.py https://huggingface.co/spaces/vorddd/GSLC-MLOps/resolve/main/tests/test_inference.py
283 Bytes
| import numpy as np | |
| from src.train import train | |
| from src.inference import predict_one | |
| def test_predict_shape_and_type(): | |
| train(smoke=True) # pastikan model ada | |
| x = np.random.rand(30) # dataset breast_cancer punya 30 fitur | |
| out = predict_one(x) | |
| assert out in (0, 1) | |