MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / apply_template

Function apply_template

scripts/unslot_training.py:25–28  ·  view source on GitHub ↗
(examples)

Source from the content-addressed store, hash-verified

23)
24
25def apply_template(examples):
26 messages = examples["messages"]
27 text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
28 return {"text": text}
29
30dataset = load_dataset("json", data_files="data/data_instruct_nav.json", split="train")
31dataset = dataset.map(apply_template)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected