feat: support alpaca, sharegpt & chatml output format #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Output Formats
we support generating datasets in alpaca, sharegpt and chatml format.
Alpaca Format
Supervised Fine-Tuning Dataset
In supervised fine-tuning, the
instructioncolumn will be concatenated with theinputcolumn and used as the user prompt, then the user prompt would beinstruction\ninput. Theoutputcolumn represents the model response.[ { "instruction": "user instruction (required)", "input": "user input (optional)", "output": "model response (required)" } ]Sharegpt Format
Supervised Fine-Tuning Dataset
Compared to the alpaca format, the sharegpt format allows the datasets have more roles, such as human, gpt, observation and function. They are presented in a list of objects in the
conversationscolumn.Note that the human and observation should appear in odd positions, while gpt and function should appear in even positions. The gpt and function will be learned by the model.
In our implementation, only
humanandgptwill be used.[ { "conversations": [ { "from": "human", "value": "user instruction (required)" }, { "from": "gpt", "value": "model response (required)" } ] } ]ChatML Format
Supervised Fine-Tuning Dataset
Like the sharegpt format, the chatml format also allows the datasets have more roles, such as user, assistant, system and tool. They are presented in a list of objects in the
messagescolumn.In our implementation, only
userandassistantwill be used.[ { "messages": [ { "role": "user", "content": "user instruction (required)" }, { "role": "assistant", "content": "model response (required)" } ] } ]