refactor: SFT 统一 messages 格式 + ChatML 纯 jinja 渲染
This commit is contained in:
@@ -6,10 +6,13 @@ def process_func(input_dict: dict):
|
||||
instruction = input_dict["instruction"]
|
||||
inp = input_dict.get("input", "")
|
||||
if inp:
|
||||
query = instruction + "\n" + inp
|
||||
content = instruction + "\n" + inp
|
||||
else:
|
||||
query = instruction
|
||||
return {"query": query, "response": input_dict["output"]}
|
||||
content = instruction
|
||||
return {"messages": [
|
||||
{"role": "user", "content": content},
|
||||
{"role": "assistant", "content": input_dict["output"]},
|
||||
]}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user