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']
|
output_text = ex['output']
|
||||||
|
|
||||||
# Create conversation format
|
# Create chat format for SFTTrainer
|
||||||
conversation = {
|
conversation = {
|
||||||
"conversations": [
|
"messages": [
|
||||||
{
|
{
|
||||||
"from": "human",
|
"role": "system",
|
||||||
"value": f"Generate a Cyron summary for this task:\n\n{instruction}\n\n{input_text}"
|
"content": "You are a helpful coding assistant that generates project summaries."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": "gpt",
|
"role": "user",
|
||||||
"value": output_text
|
"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