Download tests/test_resolve.py from thefinalboss/palimpseste-max: direct link, hf CLI and curl.
- Browser
- Download file 856 Bytes
-
https://huggingface.co/thefinalboss/palimpseste-max/resolve/main/tests/test_resolve.py
- Command line
-
hf download hf://thefinalboss/palimpseste-max/tests/test_resolve.py
-
curl -L -o test_resolve.py https://huggingface.co/thefinalboss/palimpseste-max/resolve/main/tests/test_resolve.py
856 Bytes
| """Model-dir resolution + LFS pointer detection.""" | |
| from __future__ import annotations | |
| from pathlib import Path | |
| from palimpseste.serialization import is_lfs_pointer, resolve_model_dir | |
| def test_lfs_pointer_detection(tmp_path: Path): | |
| p = tmp_path / "palimpseste_memory.bin" | |
| p.write_text( | |
| "version https://git-lfs.github.com/spec/v1\n" | |
| "oid sha256:deadbeef\n" | |
| "size 123\n" | |
| ) | |
| assert is_lfs_pointer(p) | |
| big = tmp_path / "real.bin" | |
| big.write_bytes(b"x" * 2048) | |
| assert not is_lfs_pointer(big) | |
| def test_resolve_nested_dir(tmp_path: Path): | |
| nested = tmp_path / "palimpseste-max" | |
| nested.mkdir() | |
| (nested / "config.json").write_text('{"D": 8}') | |
| assert resolve_model_dir(tmp_path) == nested | |
| (tmp_path / "config.json").write_text('{"D": 8}') | |
| assert resolve_model_dir(tmp_path) == tmp_path | |