Skip to content

Add SFT Recipe - #1271

Merged
cbalioglu merged 88 commits into
mainfrom
jacklanchantin/recipes_sft
Sep 29, 2025
Merged

Add SFT Recipe#1271
cbalioglu merged 88 commits into
mainfrom
jacklanchantin/recipes_sft

Conversation

@jacklanchantin

@jacklanchantin jacklanchantin commented Sep 4, 2025

Copy link
Copy Markdown
Contributor

What does this PR do? Please describe:
A summary of the change or the issue that is fixed.

  • Adds SFT recipe for masked input training.
  • Adapts old instruction_finetune recipe for to fit within v0.5 train recipe format.

Tested 4 configs using named assets:

dataset=alpaca, model=llama_3_2_1b
dataset=alpaca, model=llama_3_2_1b_instruct, chat_mode=true
dataset=gsm8k, model=llama_3_2_1b
dataset=gsm8k, model=llama_3_2_1b_instruct, chat_mode=true

Run using:

python -m sft /output/dir/ --config-file sft/configs/llama3_2_1b_gsm8k.yaml

Does your PR introduce any breaking changes? If yes, please list them:
List of all backwards-incompatible changes.

Check list:

  • Was the content of this PR discussed and approved via a GitHub issue? (no need for typos or documentation improvements)
  • Did you read the contributor guideline?
  • Did you make sure that your PR does only one thing instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (no need for typos, documentation, or minor internal changes)

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 4, 2025
Comment thread recipes/lm/sft/default_config.py Outdated
Comment thread recipes/lm/sft/README.md Outdated
Comment thread src/fairseq2/models/llama/tokenizer.py Outdated
Comment thread src/fairseq2/data/__init__.py Outdated
@cbalioglu
cbalioglu merged commit 479c502 into main Sep 29, 2025
15 checks passed
@cbalioglu
cbalioglu deleted the jacklanchantin/recipes_sft branch September 29, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants