Download tests/test_inference.py from aigovdev/governance-risk-classifier: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/aigovdev/governance-risk-classifier/resolve/main/tests/test_inference.py
- Command line
-
hf download hf://aigovdev/governance-risk-classifier/tests/test_inference.py
-
curl -L -o test_inference.py https://huggingface.co/aigovdev/governance-risk-classifier/resolve/main/tests/test_inference.py
1.01 kB
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT)) | |
| from inference import predict_governance_risk | |
| def test_high_risk_scenario(): | |
| result = predict_governance_risk({ | |
| "sector": "financial_services", | |
| "impact": "high", | |
| "decision_autonomy": "automated", | |
| "human_oversight": "none", | |
| "monitoring": "none", | |
| "traceability": "none", | |
| "technical_documentation": "partial", | |
| }) | |
| assert result["risk_tier"] == "unacceptable" | |
| assert "class_probabilities" in result | |
| def test_lower_risk_scenario(): | |
| result = predict_governance_risk({ | |
| "sector": "enterprise_productivity", | |
| "impact": "low", | |
| "decision_autonomy": "assistive", | |
| "human_oversight": "strong", | |
| "monitoring": "strong", | |
| "traceability": "strong", | |
| "technical_documentation": "strong", | |
| }) | |
| assert result["risk_tier"] == "lower" | |
| assert "class_probabilities" in result | |