Spaces:
Sleeping
Sleeping
Download tests/patch_view/test_constraints.py from benhong/blt-patch-view: direct link, hf CLI and curl.
- Browser
- Download file 666 Bytes
-
https://huggingface.co/spaces/benhong/blt-patch-view/resolve/main/tests/patch_view/test_constraints.py
- Command line
-
hf download hf://spaces/benhong/blt-patch-view/tests/patch_view/test_constraints.py
-
curl -L -o test_constraints.py https://huggingface.co/spaces/benhong/blt-patch-view/resolve/main/tests/patch_view/test_constraints.py
666 Bytes
| from patch_view.constraints import default_thresholds_for_metric, guard_range_for_metric | |
| def test_entropy_defaults_are_smaller_than_perplexity(): | |
| entropy_defaults = default_thresholds_for_metric("entropy") | |
| perplexity_defaults = default_thresholds_for_metric("perplexity") | |
| for name in entropy_defaults: | |
| assert entropy_defaults[name] <= perplexity_defaults[name] | |
| def test_guard_slider_ranges_change_with_metric(): | |
| entropy_guard = guard_range_for_metric("entropy") | |
| perplexity_guard = guard_range_for_metric("perplexity") | |
| assert entropy_guard.maximum < perplexity_guard.maximum | |
| assert entropy_guard.step < perplexity_guard.step | |