Skip to content

Commit 5b83bd2

Browse files
oindrillaclesebrussellb
committed
rewording doc and updated parameters, updated spellcheck
Co-authored-by: Sébastien Han <[email protected]> Co-authored-by: Russell Bryant <[email protected]> Signed-off-by: Oindrilla Chatterjee <[email protected]>
1 parent ea64144 commit 5b83bd2

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

.spellcheck-en-custom.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Containerfile
2424
cpp
2525
cuBLAS
2626
CUDA
27+
customizations
2728
CWD
2829
dataset
2930
DCO

docs/sdg/sdg-api-interface.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ We propose the following structure for the SDG library. There will be config fil
2525

2626
## CLI
2727

28-
The CLI client uses the instructlab SDG library and provides it a run configuration with input parameters.
28+
The CLI client uses the instructlab SDG library and provides it a run configuration with input parameters. The following represents a sample of what Library usage could look like.
2929

3030
```python
3131
# cli_driver.py
@@ -40,14 +40,27 @@ cli_sdg = SDG(run_config, client) # run config has all the variables like num_s
4040
generated_samples = cli_sdg.generate()
4141
```
4242

43-
The run configuration contains the parameters needed to run the SDG code library as well as points to the templates needed to run the SDG code as well as the prompt template and the default model system prompt template.
43+
As an initial integration milestone, we will modify the `generate_data` function in `instructlab.sdg.generate_data` to make use of the updated SDG API. This is the function the `ilab` CLI already uses, so modifying this implementation will allow us to get the updated SDG API in place without disrupting the CLI integration.
44+
45+
CLI integration will require additional changes later to allow passing in customizations to the SDG pipeline, but we will treat that as a follow-up implementation milestone.
46+
47+
The run configuration includes the necessary parameters for executing the SDG code library. It specifies the templates required for running the SDG code, the prompt template, and the default model system prompt template.
4448

4549
* `num_samples` is the number of synthetic samples that you wish to generate per seed example.
50+
* `num_procs` is the number of parallel processes that you want to run
4651
* `max_retry` is the maximum number of non-greedy retries you want to make if the `num_samples` is not reached. The number of samples in the generated output will be the samples achieved until `max_retry` is reached.
4752
* Pipeline steps contains the steps that you want to invoke in the SDG pipeline and the prompt configurations per step. The variable names of the blocks can be anything and the prompt configurations must be compatible with the teacher model.
4853
* `max_new_tokens` is the maximum number of tokens we want to generate. In other words, the size of the output sequence, not including the tokens in the prompt.
49-
* `model_name` is the teacher model we would want to use to generate the synthetic data.
50-
* `model_template` and `stop_token` are the parameters for generation template.
54+
* `model` is the name of the served up teacher model we would want to use to generate the synthetic data.
55+
* `model_prompt`: the default model prompt for the model.
56+
* `client` points to an OpenAI client used to interface with the model. Example of a client:
57+
58+
```python
59+
client = OpenAI(
60+
api_key=openai_api_key,
61+
base_url=openai_api_base,
62+
)
63+
```
5164

5265
```yaml
5366
# run_config.yaml
@@ -61,9 +74,8 @@ pipeline_steps:
6174
prompt_template: "configs/filter_q.yaml"
6275
max_new_tokens: 10000
6376
# model parameters for generation
64-
model_name: mistralai/Mixtral-8x7B-Instruct-v0.1
65-
# generation template
66-
model_template: <s> [INST] {sys_prompt} {prompt} [/INST]
67-
stop_token: </s>
68-
69-
```
77+
model_name: mixtral-model
78+
model_prompt: '<s> [INST] {prompt} [/INST]'
79+
client: client
80+
num_procs: 8
81+
```

0 commit comments

Comments
 (0)