-
Notifications
You must be signed in to change notification settings - Fork 8
/
example_text_generation_config.yaml
94 lines (90 loc) · 2.58 KB
/
example_text_generation_config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
settings:
referencing_keys:
sample_key: input_ids
prediction_key: logits
model_path: ./checkpoints/2024-06-27__14-17-52/eid_2024-06-27__14-17-52-model-num_steps_48-num_tokens_393216.bin
device: 0
sequence_length: 1024
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
sequence_length: ${settings.sequence_length}
eod_token: <|endoftext|>
prompt_template: "{prompt_input}" # "<instruction> Du bist Moody, ein LLM welches Menschen helfen soll. user: {prompt_input}"
temperature: 1
# 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: model
pass_type: BY_REFERENCE
checkpoint_path: ${settings.model_path}
model:
component_key: model
variant_key: gpt2
config:
sample_key: ${settings.referencing_keys.sample_key}
poe_type: NOPE
sequence_length: ${settings.sequence_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: 2
n_head_q: 8
n_head_kv: 8
ffn_hidden: 128
n_embd: 128
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: ${model.config.n_embd}
n_head: ${model.config.n_head_q} #it has to be head_q here
seq_length_dim: -2
attention_implementation: manual
activation_type: gelu
attention_norm:
component_key: layer_norm
variant_key: rms_norm
config:
ndim: ${model.config.n_embd}
bias: true
epsilon: 1e-5
ffn_norm:
component_key: layer_norm
variant_key: rms_norm
config:
ndim: ${model.config.n_embd}
bias: true
epsilon: 1e-5
lm_head_norm:
component_key: layer_norm
variant_key: rms_norm
config:
ndim: ${model.config.n_embd}
bias: true
epsilon: 1e-5
tokenizer:
component_key: tokenizer
variant_key: pretrained_hf_tokenizer
config:
pretrained_model_name_or_path: tokenizer
padding: false
truncation: false