Instructions to use XXXpilar/Fastfill-test with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use XXXpilar/Fastfill-test with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Download code/fastfill/v2/tests/test_constraint_schema.py from XXXpilar/Fastfill-test: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/XXXpilar/Fastfill-test/resolve/main/code/fastfill/v2/tests/test_constraint_schema.py
- Command line
-
hf download hf://XXXpilar/Fastfill-test/code/fastfill/v2/tests/test_constraint_schema.py
-
curl -L -o test_constraint_schema.py https://huggingface.co/XXXpilar/Fastfill-test/resolve/main/code/fastfill/v2/tests/test_constraint_schema.py
1.33 kB
| from copy import deepcopy | |
| import pytest | |
| from fastfill.v2.schema import validate_condition | |
| from fastfill.v2.tests.test_execution import sample | |
| def test_between_rejects_malformed_or_invalid_reference_list(targets): | |
| condition = deepcopy(sample()["condition"]) | |
| condition["objects"] += [{"id": "b", "category": "chair", "description": "chair"}, | |
| {"id": "c", "category": "chair", "description": "chair"}] | |
| condition["constraints"] = [{"type": "between", "object_id": "a", "target_ids": targets}] | |
| with pytest.raises(ValueError, match="between"): | |
| validate_condition(condition) | |
| def test_between_and_against_wall_validate_without_rewriting_condition(): | |
| condition = deepcopy(sample()["condition"]) | |
| condition["objects"] += [{"id": "b", "category": "chair", "description": "chair"}, | |
| {"id": "c", "category": "chair", "description": "chair"}] | |
| condition["constraints"] = [{"type": "between", "object_id": "a", "target_ids": ["b", "c"]}, | |
| {"type": "against_wall", "object_id": "b", "tolerance_m": .1}] | |
| before = deepcopy(condition) | |
| validate_condition(condition) | |
| assert condition == before | |