Spaces:
Runtime error
Runtime error
Download tests/utils/test_utils.py from Safe-Harbor/LLMGuardian: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/spaces/Safe-Harbor/LLMGuardian/resolve/main/tests/utils/test_utils.py
- Command line
-
hf download hf://spaces/Safe-Harbor/LLMGuardian/tests/utils/test_utils.py
-
curl -L -o test_utils.py https://huggingface.co/spaces/Safe-Harbor/LLMGuardian/resolve/main/tests/utils/test_utils.py
699 Bytes
| """ | |
| tests/utils/test_utils.py - Testing utilities and helpers | |
| """ | |
| import json | |
| from pathlib import Path | |
| from typing import Any, Dict, Optional | |
| import numpy as np | |
| def load_test_data(filename: str) -> Dict[str, Any]: | |
| """Load test data from JSON file""" | |
| data_path = Path(__file__).parent.parent / "data" / filename | |
| with open(data_path) as f: | |
| return json.load(f) | |
| def compare_privacy_results(result1: Dict[str, Any], result2: Dict[str, Any]) -> bool: | |
| """Compare two privacy check results""" | |
| # Compare basic fields | |
| if result1["compliant"] != result2["compliant"]: | |
| return False | |
| if result1["risk_level"] != result2["risk_level"]: | |
| return False | |
| # | |