Download tests/test_models.py from hembad/reranker: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/spaces/hembad/reranker/resolve/main/tests/test_models.py
- Command line
-
hf download hf://spaces/hembad/reranker/tests/test_models.py
-
curl -L -o test_models.py https://huggingface.co/spaces/hembad/reranker/resolve/main/tests/test_models.py
669 Bytes
| """GGUF client helpers — Qwen3 <think> stripping (no model load needed).""" | |
| from __future__ import annotations | |
| from models.llm import _strip_thinking | |
| def test_strips_closed_think_block() -> None: | |
| assert _strip_thinking("<think>chain of thought</think>The answer.") == "The answer." | |
| def test_strips_dangling_unclosed_think() -> None: | |
| # a truncated reasoning block (ran out of tokens) leaves only what precedes it | |
| assert _strip_thinking("Result line\n<think>reasoning that got cut") == "Result line" | |
| def test_plain_text_is_untouched_but_trimmed() -> None: | |
| assert _strip_thinking(" Senior AI Engineer profile ") == "Senior AI Engineer profile" | |