Download tests/test_runtime.py from ramachandrajoshi/LoopedPhai-A1-35B: direct link, hf CLI and curl.
- Browser
- Download file 894 Bytes
-
https://huggingface.co/ramachandrajoshi/LoopedPhai-A1-35B/resolve/main/tests/test_runtime.py
- Command line
-
hf download hf://ramachandrajoshi/LoopedPhai-A1-35B/tests/test_runtime.py
-
curl -L -o test_runtime.py https://huggingface.co/ramachandrajoshi/LoopedPhai-A1-35B/resolve/main/tests/test_runtime.py
894 Bytes
| """Runtime config resolution (no GPU, no vLLM needed).""" | |
| from __future__ import annotations | |
| from types import SimpleNamespace | |
| from looped_qwen_moe.vllm_plugin.runtime import model_relative_adapter, resolve_runtime | |
| def test_config_looped_dict(): | |
| cfg = SimpleNamespace(looped={"adapter": "./adapter", "num_passes": 3}) | |
| rt = resolve_runtime(cfg, SimpleNamespace()) | |
| assert rt.adapter == "./adapter" and rt.num_passes == 3 | |
| def test_model_relative_adapter(tmp_path): | |
| assert model_relative_adapter("./adapter", "org/repo") == "org/repo:adapter" | |
| assert model_relative_adapter("./adapter", "org/repo", "abc123") == "org/repo@abc123:adapter" | |
| assert model_relative_adapter("./adapter", str(tmp_path)) == str(tmp_path / "adapter") | |
| assert model_relative_adapter("other/repo:sub", "org/repo") == "other/repo:sub" | |
| assert model_relative_adapter(None, "org/repo") is None | |