Spaces:
Sleeping
Sleeping
Download tests/test_classifier.py from cvachet/iris_classification_lambda: direct link, hf CLI and curl.
- Browser
- Download file 536 Bytes
-
https://huggingface.co/spaces/cvachet/iris_classification_lambda/resolve/c072afcd802bcf543b67bcc09bfa5611552386f3/tests/test_classifier.py
- Command line
-
hf download hf://spaces/cvachet/iris_classification_lambda@c072afcd802bcf543b67bcc09bfa5611552386f3/tests/test_classifier.py
-
curl -L -o test_classifier.py https://huggingface.co/spaces/cvachet/iris_classification_lambda/resolve/c072afcd802bcf543b67bcc09bfa5611552386f3/tests/test_classifier.py
536 Bytes
| import pytest | |
| from classification.classifier import Classifier | |
| def setup_pipeline(): | |
| pipeline = Classifier() | |
| pipeline.train_and_save() | |
| return pipeline | |
| def requests(): | |
| return { | |
| "features": [ | |
| [6.5, 3.0, 5.8, 2.2], | |
| [6.1, 2.8, 4.7, 1.2] | |
| ] | |
| } | |
| def response(): | |
| return ['virginica', 'versicolor'] | |
| def test_response(setup_pipeline, requests, response): | |
| assert response == setup_pipeline.load_and_test(requests)['predictions'] | |