llama-factory fine-tuning

发布时间 2023-11-29 12:53:19作者: Daze_Lu

data preparation

for llama-factory fine-tuning, here is the instruction for custom dataset preparation.

dataset classification

alpaca

stanford_alpaca dataset is a famous example to fine-tuning llama2 to get alpaca model, follow is its structure. 

[
  {
    "instruction": "user instruction (required)",
    "input": "user input (optional)",
    "output": "model response (required)",
    "history": [
      ["user instruction in the first round (optional)", "model response in the first round (optional)"],
      ["user instruction in the second round (optional)", "model response in the second round (optional)"]
    ]
  }
]

from bellow digraph, you can get how they get alpaca model: 

 

 

sharegpt

ShareGPT is a dialogue dataset actively contributed to and shared by users. It contains conversation samples from different domains, topics, styles, and emotions, covering a variety of types such as chit-chat, Q&A, stories, poetry, and song lyrics. This dataset is characterized by high quality, diversity, personalization, and emotional richness, which can provide conversational robots with more abundant and authentic linguistic knowledge and semantic information.

here is it's data structure.

[
  {
    "conversations": [
      {
        "from": "human",
        "value": "user instruction"
      },
      {
        "from": "gpt",
        "value": "model response"
      }
    ]
  }
]