-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pydantic-warnings-cli
- Loading branch information
Showing
122 changed files
with
6,637 additions
and
1,764 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 |
---|---|---|
|
@@ -156,4 +156,6 @@ docs/source/generated | |
docs/source/api | ||
pyenv* | ||
.devcontainer/ | ||
noteboks/* | ||
noteboks/* | ||
|
||
tests/tmp/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
settings: | ||
src_path: /workspaces/modalities/data/cc_en/raw/train.jsonl | ||
dst_path: /workspaces/modalities/data/cc_en/processed/train.pbin | ||
index_path: /workspaces/modalities/data/cc_en/processed/train.idx | ||
jq_pattern: .text | ||
num_cpus: ${node_env:num_cpus} | ||
eod_token: <eod> | ||
processing_batch_size: 1000 | ||
raw_samples_queue_size: 300 | ||
processed_samples_queue_size: 300 | ||
|
||
tokenizer: | ||
component_key: tokenizer | ||
variant_key: pretrained_sp_tokenizer | ||
config: | ||
tokenizer_model_file: /workspaces/modalities/data/tokenizer/sp_bpe_en/bpe_tokenizer.model | ||
padding: false | ||
max_length: 2048 |
93 changes: 93 additions & 0 deletions
93
config_files/text_generation/text_generation_config_torch.yaml
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,93 @@ | ||
settings: | ||
referencing_keys: | ||
sample_key: input_ids | ||
prediction_key: logits | ||
model_path: /raid/s3/opengptx/max_lue/modalities/data/checkpoints/2024-04-22__13-16-03/eid_2024-04-22__13-16-03-model-num_steps_1152.bin | ||
device: 0 | ||
context_length: 2048 | ||
|
||
text_inference_component: | ||
component_key: inference_component | ||
variant_key: text | ||
config: | ||
device: ${settings.device} | ||
model: | ||
instance_key: checkpointed_model | ||
pass_type: BY_REFERENCE | ||
tokenizer: | ||
instance_key: tokenizer | ||
pass_type: BY_REFERENCE | ||
context_length: ${settings.context_length} | ||
eod_token: <eod> | ||
prompt_template: "{prompt_input}" # "<instruction> Du bist Moody, ein LLM welches Menschen helfen soll. user: {prompt_input}" | ||
temperature: 0 | ||
# chat: false | ||
|
||
checkpointed_model: | ||
component_key: model | ||
variant_key: checkpointed | ||
config: | ||
checkpoint_loading: | ||
component_key: checkpoint_loading | ||
variant_key: torch | ||
config: | ||
device: ${settings.device} | ||
precision: BF16 | ||
model: | ||
instance_key: raw_model | ||
pass_type: BY_REFERENCE | ||
checkpoint_path: ${settings.model_path} | ||
|
||
raw_model: | ||
component_key: model | ||
variant_key: gpt2 | ||
config: | ||
sample_key: ${settings.referencing_keys.sample_key} | ||
poe_type: ABSOLUTE | ||
block_size: ${settings.context_length} | ||
prediction_key: ${settings.referencing_keys.prediction_key} | ||
vocab_size: 50304 # GPT-2 vocab_size of 50257, padded up to nearest multiple of 64 for efficiency | ||
n_layer: 12 | ||
n_head_q: 12 | ||
n_head_kv: 12 | ||
ffn_hidden: 2048 | ||
n_embd: 768 | ||
dropout: 0.0 | ||
bias: true # True: bias in Linears, like GPT-2. False: a bit better and faster | ||
attention_config: | ||
qkv_transforms: | ||
- type_hint: IdentityTransform | ||
config: {} | ||
activation_type: gelu | ||
weight_init: | ||
mean: 0.0 | ||
std: 0.02 | ||
attention_norm: | ||
component_key: layer_norm | ||
variant_key: rms_norm | ||
config: | ||
ndim: ${raw_model.config.n_embd} | ||
bias: true | ||
epsilon: 1e-5 | ||
ffn_norm: | ||
component_key: layer_norm | ||
variant_key: rms_norm | ||
config: | ||
ndim: ${raw_model.config.n_embd} | ||
bias: true | ||
epsilon: 1e-5 | ||
lm_head_norm: | ||
component_key: layer_norm | ||
variant_key: rms_norm | ||
config: | ||
ndim: ${raw_model.config.n_embd} | ||
bias: true | ||
epsilon: 1e-5 | ||
|
||
tokenizer: | ||
component_key: tokenizer | ||
variant_key: pretrained_hf_tokenizer | ||
config: | ||
pretrained_model_name_or_path: /raid/s3/opengptx/max_lue/modalities/data/tokenizer/hf_gpt2 | ||
padding: false | ||
max_length: ${settings.context_length} |
96 changes: 96 additions & 0 deletions
96
config_files/text_generation/text_generation_overfitted_de.yaml
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,96 @@ | ||
settings: | ||
referencing_keys: | ||
sample_key: input_ids | ||
prediction_key: logits | ||
model_path: /raid/s3/opengptx/max_lue/modalities/data/checkpoints/2024-04-28__13-06-00/eid_2024-04-28__13-06-00-model-num_steps_256.bin | ||
device: 0 | ||
context_length: 2048 | ||
|
||
text_inference_component: | ||
component_key: inference_component | ||
variant_key: text | ||
config: | ||
device: ${settings.device} | ||
model: | ||
instance_key: checkpointed_model | ||
pass_type: BY_REFERENCE | ||
tokenizer: | ||
instance_key: tokenizer | ||
pass_type: BY_REFERENCE | ||
context_length: ${settings.context_length} | ||
eod_token: <eod> | ||
prompt_template: "{prompt_input}" # "<instruction> Du bist Moody, ein LLM welches Menschen helfen soll. user: {prompt_input}" | ||
temperature: 0 | ||
# chat: false | ||
|
||
checkpointed_model: | ||
component_key: model | ||
variant_key: checkpointed | ||
config: | ||
checkpoint_loading: | ||
component_key: checkpoint_loading | ||
variant_key: torch | ||
config: | ||
device: ${settings.device} | ||
precision: FP16 | ||
model: | ||
instance_key: raw_model | ||
pass_type: BY_REFERENCE | ||
checkpoint_path: ${settings.model_path} | ||
|
||
raw_model: | ||
component_key: model | ||
variant_key: gpt2 | ||
config: | ||
sample_key: ${settings.referencing_keys.sample_key} | ||
poe_type: NOPE | ||
block_size: ${settings.context_length} | ||
prediction_key: ${settings.referencing_keys.prediction_key} | ||
vocab_size: 50304 # GPT-2 vocab_size of 50257, padded up to nearest multiple of 64 for efficiency | ||
n_layer: 12 | ||
n_head_q: 12 | ||
n_head_kv: 12 | ||
ffn_hidden: 2048 | ||
n_embd: 768 | ||
dropout: 0.0 | ||
bias: true # True: bias in Linears, like GPT-2. False: a bit better and faster | ||
attention_config: | ||
qkv_transforms: | ||
- type_hint: RotaryTransform | ||
config: | ||
n_embd: ${raw_model.config.n_embd} | ||
n_head: ${raw_model.config.n_head_q} #it has to be head_q here | ||
seq_length_dim: -2 | ||
activation_type: gelu | ||
weight_init: | ||
mean: 0.0 | ||
std: 0.02 | ||
attention_norm: | ||
component_key: layer_norm | ||
variant_key: rms_norm | ||
config: | ||
ndim: ${raw_model.config.n_embd} | ||
bias: true | ||
epsilon: 1e-5 | ||
ffn_norm: | ||
component_key: layer_norm | ||
variant_key: rms_norm | ||
config: | ||
ndim: ${raw_model.config.n_embd} | ||
bias: true | ||
epsilon: 1e-5 | ||
lm_head_norm: | ||
component_key: layer_norm | ||
variant_key: rms_norm | ||
config: | ||
ndim: ${raw_model.config.n_embd} | ||
bias: true | ||
epsilon: 1e-5 | ||
|
||
tokenizer: | ||
component_key: tokenizer | ||
variant_key: pretrained_hf_tokenizer | ||
config: | ||
pretrained_model_name_or_path: /raid/s3/opengptx/max_lue/modalities/data/tokenizer/hf_gpt2 | ||
padding: false | ||
max_length: ${settings.context_length} |
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.