fix: use messages format for SFTTrainer (system/user/assistant)
This commit is contained in:
@@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user