reranker / tests /test_models.py
Hemprasad Badgujar
Add JD parsing, central config, checkpoints & LLM
700e896
Raw History Blame Contribute Delete
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"