Spaces:
Running on Zero
Running on Zero
Download src/test_predict.py from Evasim/Simple-Text-Classifier: direct link, hf CLI and curl.
- Browser
- Download file 376 Bytes
-
https://huggingface.co/spaces/Evasim/Simple-Text-Classifier/resolve/main/src/test_predict.py
- Command line
-
hf download hf://spaces/Evasim/Simple-Text-Classifier/src/test_predict.py
-
curl -L -o test_predict.py https://huggingface.co/spaces/Evasim/Simple-Text-Classifier/resolve/main/src/test_predict.py
376 Bytes
| import os | |
| import pytest | |
| from src.predict import LABEL_DECODER, predict | |
| pytestmark = pytest.mark.skipif( | |
| "HF_REPO_ID" not in os.environ, reason="requires HF_REPO_ID (downloads the real checkpoint)" | |
| ) | |
| def test_predict_returns_known_label(): | |
| label = predict("Wall Street stocks rallied after the Federal Reserve meeting.") | |
| assert label in LABEL_DECODER.values() | |