The Command-Line Interface (CLI) is a crucial feature in fairseq2, offering users a powerful and flexible way to interact with the framework.
With the CLI, you can quickly and easily execute tasks, customize recipes and configurations, and perform complex operations such as sweep runs and benchmarking.
# Get help about available commands
fairseq2-h
# Get help about a specific command group (e.g. recipe lm)
fairseq2lm-h
# Get help about a specific command (e.g. recipe lm::instruction_finetune)
fairseq2lminstruction_finetune-h
# List available presets for a recipe (e.g. recipe lm::instruction_finetune)
fairseq2lminstruction_finetune--list-presets
# Dump the default configuration for a recipe (e.g. recipe lm::instruction_finetune)
fairseq2lminstruction_finetune--dump-config
# Run a recipe with default settings (e.g. recipe lm::instruction_finetune)
fairseq2lminstruction_finetune<OUTPUT_DIR>
# Run a recipe with a custom config file (e.g. recipe lm::instruction_finetune)
fairseq2lminstruction_finetune<OUTPUT_DIR>--config-file<YOUR_CONFIG>.yaml
You can specify one or multiple YAML config files:
# Single config file
fairseq2lminstruction_finetune<OUTPUT_DIR>--config-fileconfig1.yaml
# Multiple config files (merged from left to right)
fairseq2lminstruction_finetune<OUTPUT_DIR>--config-filebase.yaml--config-fileoverride.yaml
Use add: and del: directives for more advanced configuration:
# Add a new configuration value
fairseq2lminstruction_finetune<OUTPUT_DIR>--configadd:new_param=value
# Remove a configuration value
fairseq2lminstruction_finetune<OUTPUT_DIR>--configdel:unwanted_param
fairseq2 provides commands to manage and inspect assets:
# List all available assets
fairseq2assetslist
# Show details of a specific asset
fairseq2assetsshowllama3_1_8b_instruct
# List assets filtered by type
fairseq2assetslist--typemodel
fairseq2assetslist--typedataset
fairseq2assetslist--typetokenizer