MCPcopy
hub / github.com/z-lab/dflash / _apply_chat_template

Function _apply_chat_template

dflash/benchmark.py:103–109  ·  view source on GitHub ↗
(tokenizer, messages: list[dict], enable_thinking: bool)

Source from the content-addressed store, hash-verified

101
102
103def _apply_chat_template(tokenizer, messages: list[dict], enable_thinking: bool) -> str:
104 return tokenizer.apply_chat_template(
105 messages,
106 tokenize=False,
107 add_generation_prompt=True,
108 enable_thinking=enable_thinking,
109 )
110
111
112def _make_decode_metrics(num_output_tokens: int, generation_tps: float, acceptance_lengths: list[int]) -> SimpleNamespace:

Callers 3

_run_transformersFunction · 0.85
_run_mlxFunction · 0.85
_run_serverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected