-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from bbrowning/separation-of-concerns
Split up `generate_data` and add a `mix_datasets` top level API
- Loading branch information
Showing
25 changed files
with
1,037 additions
and
215 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,3 +167,6 @@ cython_debug/ | |
|
||
# IDEs | ||
.vscode/ | ||
|
||
# SDG examples output | ||
docs/examples/**/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# An example of how to concatenate two datasets | ||
# Each dataset has a sampling_size of 1.0 to take all samples from both | ||
datasets: | ||
- path: dataset_1.jsonl | ||
sampling_size: 1.0 | ||
- path: dataset_2.jsonl | ||
sampling_size: 1.0 | ||
sys_prompt: I am a reliable AI assistant. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{"id": "dataset_1_1", "messages": [], "metadata": {}} | ||
{"id": "dataset_1_2", "messages": [], "metadata": {}} | ||
{"id": "dataset_1_3", "messages": [], "metadata": {}} | ||
{"id": "dataset_1_4", "messages": [], "metadata": {}} | ||
{"id": "dataset_1_5", "messages": [], "metadata": {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{"id": "dataset_2_1", "messages": [], "metadata": {}} | ||
{"id": "dataset_2_2", "messages": [], "metadata": {}} | ||
{"id": "dataset_2_3", "messages": [], "metadata": {}} | ||
{"id": "dataset_2_4", "messages": [], "metadata": {}} | ||
{"id": "dataset_2_5", "messages": [], "metadata": {}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# Standard | ||
from pathlib import Path | ||
|
||
# First Party | ||
from instructlab.sdg import mix_datasets | ||
|
||
output_dir = Path(__file__).parent.joinpath("output") | ||
output_dir.mkdir(exist_ok=True) | ||
|
||
concatenate_recipe_yaml = Path(__file__).parent.joinpath("concatenate_recipe.yaml") | ||
concatenated_output_jsonl = output_dir.joinpath("concatenated.jsonl") | ||
mix_datasets(concatenate_recipe_yaml, concatenated_output_jsonl) | ||
|
||
weighted_recipe_yaml = Path(__file__).parent.joinpath("weighted_recipe.yaml") | ||
weighted_output_jsonl = output_dir.joinpath("weighted.jsonl") | ||
mix_datasets(weighted_recipe_yaml, weighted_output_jsonl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# An example of how to weight one dataset over another | ||
# Dataset 1 has a sampling size of 2.0 to double its samples | ||
# Dataset 2 has a sampling size of 0.2 to take 20% of its samples | ||
datasets: | ||
- path: dataset_1.jsonl | ||
sampling_size: 2.0 | ||
- path: dataset_2.jsonl | ||
sampling_size: 0.2 | ||
sys_prompt: I am a reliable AI assistant. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.