Chapter 3. Adding skills to your taxonomy tree
The starter model can learn custom skills by populating the qna.yaml file with your domain specific skill. Each qna.yaml file for skills contains a set of key-value entries with the following keys:
| Field | Desciption | Restraints |
|---|---|---|
|
|
The version of the | The currently supported value for this parameter is 2. |
|
| Your Git username or name of contributor. | None |
|
| A description of your skill and its function. | None |
|
| A collection of key and value entries. |
Each |
|
| Grounded skills require the user to provide additional context containing information that the model needs to know for executing the skill. |
This filed is required for grounded skills. Each |
|
| Specify a question for the model. |
Each |
|
| Specify an answer for the model. |
Each |
3.1. Creating a skill YAML file Copy linkLink copied to clipboard!
You can customize your taxonomy tree so the model can learn new skills for your desired use cases. The following procedure displays how to create a taxonomy tree that contains your skill qna.yaml file.
Prerequisites
- You installed RHEL AI with the bootable container image.
-
You initialized InstructLab and can use the
ilabCLI. - You have root user access on your machine.
Procedure
Navigate to the
compositional_skillsfolder the taxonomy directory.ImportantCreating foundational skills, skills involving creating code, is not currently supported on RHEL AI version 1.5.
Based on the directories that exist in the tree, select where in the tree you want to add your skill
qna.yamlfile.Example file path in the taxonomy tree
taxonomy/compositional_skills/grounded/<add_example>/qna.yaml
taxonomy/compositional_skills/grounded/<add_example>/qna.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Using your desired text editor, create the
qna.yamlfile.NoteFor SDG to run properly, you must include at least five question and answer pair examples in your
qna.yamlfile.-
Add the necessary keys to the
qna.yamlfile and save your changes. For more information on formatting yourqna.yamlfile, see "Sample skill YAML specifications".
Verification
To verify that your skill is in the proper format, you can run the following command:
ilab taxonomy diff
$ ilab taxonomy diffCopy to Clipboard Copied! Toggle word wrap Toggle overflow The CLI displays if your taxonomy tree and
qna.yamlfile is valid and properly formatted. The CLI also displays where to fix any errors you may encounter.Example output of valid taxonomy tree and
qna.yamlfilecompositional_skills/writing/freeform/<example>/qna.yaml Taxonomy in /taxonomy/ is valid :)
compositional_skills/writing/freeform/<example>/qna.yaml Taxonomy in /taxonomy/ is valid :)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of invalid taxonomy tree and
qna.yamlfile with errors6:11 error syntax error: mapping values are not allowed here (syntax) Reading taxonomy failed with the following error: 1 taxonomy with errors! Exiting.
6:11 error syntax error: mapping values are not allowed here (syntax) Reading taxonomy failed with the following error: 1 taxonomy with errors! Exiting.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Sample skills YAML specifications Copy linkLink copied to clipboard!
Skills share a similar question and answer layout as knowledge YAML files. On RHEL AI, the synthetic data generation (SDG) process uses your qna.yaml seed examples to create a large set of artificial data for the model to learn, rather than relying exclusively on user generated data.
The order of the question, answer, and context pairs does not influence the SDG or training process. There are multiple types of skills that are split into categories: freeform, grounded, and foundational skills. You can see samples of each category in the following examples:
Example freeform compositional skill qna.yaml file
Example grounded compositional skill qna.yaml file
- 1 1
- Specify the version of the skill
qna.yamlformat. - 2 2
- Specify your name or git username.
- 3 3
- Specify a description of your skill and its function.
- 4
- Specify additional context containing information that the model needs to know for executing the skill. Required for grounded skills.
- 4 5
- Specify a question for the model.
- 5 6
- Specify the desired response from the model.