MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / to_chat_text

Function to_chat_text

tests/generate_inputs.py:7–15  ·  view source on GitHub ↗
(tokenizer: AutoTokenizer, prompt: str)

Source from the content-addressed store, hash-verified

5
6
7def to_chat_text(tokenizer: AutoTokenizer, prompt: str) -> str:
8 messages = [{"role": "user", "content": prompt}]
9 text = tokenizer.apply_chat_template(
10 messages,
11 tokenize=False,
12 add_generation_prompt=True,
13 enable_thinking=True,
14 )
15 return text
16
17
18def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected