fix: use messages format for SFTTrainer (system/user/assistant)

This commit is contained in:
Christian Medina
2026-06-30 21:05:48 -04:00
parent d8ad31fd03
commit ed0b1eddf8

View File

@@ -36,16 +36,20 @@ def prepare_dataset(input_file, output_file, test_size=0.05):
output_text = ex['output']
# Create conversation format
# Create chat format for SFTTrainer
conversation = {
"conversations": [
"messages": [
{
"from": "human",
"value": f"Generate a Cyron summary for this task:\n\n{instruction}\n\n{input_text}"
"role": "system",
"content": "You are a helpful coding assistant that generates project summaries."
},
{
"from": "gpt",
"value": output_text
"role": "user",
"content": f"Generate a summary for this task:\n\n{instruction}\n\n{input_text}"
},
{
"role": "assistant",
"content": output_text
}
]
}