mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2026-01-13 01:20:35 +08:00
[v1] add renderer ut (#9722)
This commit is contained in:
@@ -61,11 +61,11 @@ def test_sharegpt_converter():
|
||||
}
|
||||
expected_data = {
|
||||
"messages": [
|
||||
{"content": [{"type": "text", "value": "System"}], "loss_weight": 0.0, "role": "system"},
|
||||
{"content": [{"type": "text", "value": "User"}], "loss_weight": 0.0, "role": "user"},
|
||||
{"content": [{"type": "tool_call", "value": "1"}], "loss_weight": 1.0, "role": "assistant"},
|
||||
{"content": [{"type": "text", "value": "Observation"}], "loss_weight": 0.0, "role": "tool"},
|
||||
{"content": [{"type": "text", "value": "Assistant"}], "loss_weight": 1.0, "role": "assistant"},
|
||||
{"role": "system", "content": [{"type": "text", "value": "System"}], "loss_weight": 0.0},
|
||||
{"role": "user", "content": [{"type": "text", "value": "User"}], "loss_weight": 0.0},
|
||||
{"role": "assistant", "content": [{"type": "tool_call", "value": "1"}], "loss_weight": 1.0},
|
||||
{"role": "tool", "content": [{"type": "text", "value": "Observation"}], "loss_weight": 0.0},
|
||||
{"role": "assistant", "content": [{"type": "text", "value": "Assistant"}], "loss_weight": 1.0},
|
||||
]
|
||||
}
|
||||
assert DataConverterPlugin("sharegpt")(example) == expected_data
|
||||
|
||||
Reference in New Issue
Block a user