Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training template #8

Open
ZZZYYYLL opened this issue Nov 11, 2024 · 1 comment
Open

Training template #8

ZZZYYYLL opened this issue Nov 11, 2024 · 1 comment

Comments

@ZZZYYYLL
Copy link

ZZZYYYLL commented Nov 11, 2024

Hi, thanks for the great work. I have a question for how to transforming the training dataset to fit llama_factory format

I'd like to ask for advice on how to properly construct the training data format for llama_factory fine-tuning. I found FollowIR-7B's training set on huggingface, and the format is as follows:

{
  "score": "the score from Mistral-Instruct-7B-v0.2 of whether it was relevant or not (1 is relevant, 0 is not)"
  "label": "the label of relevance from GPT-3.5-Turbo-1106 who created the document"
  "id": "the id from the original TREC track and the file it came from"
  "document": "the synthetic document produced by GPT-3.5-Turbo-1106 given the original instruction, query, and label"
  "query": "the query written by TREC"
  "instruction": "the instruction (or narrative) written by TREC for human annotation"
}

For fitting the llama_factory 's format, Should the format I build for fine-tuning look like this:

{
   "instruction": "<s> [INST] You are an expert Google searcher, whose job is to determine if the following document is relevant to the query (true/false). Answer using only one word, one of those two choices.\n"
   "input": "Query: {query}  {instruction}\n Document: {document}\n Relevant (only output one word, either \"true\" or \"false\"): [/INST]"
   "output": "{label}"
}

I will appreciate it if you can give me an example for it.

@orionw
Copy link
Owner

orionw commented Nov 11, 2024

Thanks for the interest! Here's an example: #5 (comment)

Your format looks correct offhand, but I would probably do a diff to be certain. EDIT: ah I think you're adding the Mistral tokens, but llama factory does that with the --template flag. There are probably a few other small differences like that between the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants