Download tests/test_chat_cached_model_normalization.py from Nerdur/Odisej: direct link, hf CLI and curl.
- Browser
- Download file 705 Bytes
-
https://huggingface.co/spaces/Nerdur/Odisej/resolve/main/tests/test_chat_cached_model_normalization.py
- Command line
-
hf download hf://spaces/Nerdur/Odisej/tests/test_chat_cached_model_normalization.py
-
curl -L -o test_chat_cached_model_normalization.py https://huggingface.co/spaces/Nerdur/Odisej/resolve/main/tests/test_chat_cached_model_normalization.py
705 Bytes
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| def test_chat_context_uses_cached_models_before_live_model_probe(): | |
| source = (ROOT / "routes" / "chat_helpers.py").read_text() | |
| assert "def _normalize_model_id_from_cache" in source | |
| assert "cached_models" in source | |
| assert "norm = _normalize_model_id_from_cache(sess) or normalize_model_id" in source | |
| def test_cached_model_match_keeps_basename_normalization(): | |
| source = (ROOT / "routes" / "chat_helpers.py").read_text() | |
| assert "def _match_cached_model_id" in source | |
| assert "os.path.basename(requested.rstrip(\"/\"))" in source | |
| assert "os.path.basename(model_id.rstrip(\"/\")) == req_base" in source | |