phpaiola commited on
Commit
2e3f20f
1 Parent(s): 5a5ad83

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +22 -1
  2. adapter_config.json +26 -0
  3. adapter_model.bin +3 -0
  4. xtuner_config.py +211 -0
README.md CHANGED
@@ -1,3 +1,24 @@
1
  ---
2
- license: mit
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: peft
3
  ---
4
+ ## Training procedure
5
+
6
+
7
+ The following `bitsandbytes` quantization config was used during training:
8
+ - quant_method: bitsandbytes
9
+ - _load_in_8bit: False
10
+ - _load_in_4bit: True
11
+ - llm_int8_threshold: 6.0
12
+ - llm_int8_skip_modules: None
13
+ - llm_int8_enable_fp32_cpu_offload: False
14
+ - llm_int8_has_fp16_weight: False
15
+ - bnb_4bit_quant_type: nf4
16
+ - bnb_4bit_use_double_quant: True
17
+ - bnb_4bit_compute_dtype: float16
18
+ - bnb_4bit_quant_storage: uint8
19
+ - load_in_4bit: True
20
+ - load_in_8bit: False
21
+ ### Framework versions
22
+
23
+
24
+ - PEFT 0.5.0
adapter_config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "auto_mapping": null,
3
+ "base_model_name_or_path": "/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48",
4
+ "bias": "none",
5
+ "fan_in_fan_out": false,
6
+ "inference_mode": true,
7
+ "init_lora_weights": true,
8
+ "layers_pattern": null,
9
+ "layers_to_transform": null,
10
+ "lora_alpha": 16,
11
+ "lora_dropout": 0.1,
12
+ "modules_to_save": null,
13
+ "peft_type": "LORA",
14
+ "r": 64,
15
+ "revision": null,
16
+ "target_modules": [
17
+ "up_proj",
18
+ "gate_proj",
19
+ "q_proj",
20
+ "v_proj",
21
+ "o_proj",
22
+ "k_proj",
23
+ "down_proj"
24
+ ],
25
+ "task_type": "CAUSAL_LM"
26
+ }
adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c777993a5ef25fc130aa5e2bf202bfe870704e8d41cce48988718dcc062877b9
3
+ size 156984186
xtuner_config.py ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SYSTEM = 'xtuner.utils.SYSTEM_TEMPLATE.alpaca'
2
+ accumulative_counts = 16
3
+ alpaca_en = dict(
4
+ dataset=dict(
5
+ data_files=
6
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/datasets--recogna-nlp--ultra-alpaca-ptbr/snapshots/e69900d074177d370a911096fc30bdf407eff666/train.json',
7
+ path='json',
8
+ type='datasets.load_dataset'),
9
+ dataset_map_fn='xtuner.dataset.map_fns.ultracabrita_map_fn',
10
+ max_length=2048,
11
+ pack_to_max_length=True,
12
+ remove_unused_columns=True,
13
+ shuffle_before_pack=True,
14
+ template_map_fn=dict(
15
+ template='xtuner.utils.PROMPT_TEMPLATE.gemma',
16
+ type='xtuner.dataset.map_fns.template_map_fn_factory'),
17
+ tokenizer=dict(
18
+ padding_side='right',
19
+ pretrained_model_name_or_path=
20
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48',
21
+ trust_remote_code=True,
22
+ type='transformers.AutoTokenizer.from_pretrained'),
23
+ type='xtuner.dataset.process_hf_dataset',
24
+ use_varlen_attn=False)
25
+ alpaca_en_path = '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/datasets--recogna-nlp--ultra-alpaca-ptbr/snapshots/e69900d074177d370a911096fc30bdf407eff666/train.json'
26
+ batch_size = 2
27
+ betas = (
28
+ 0.9,
29
+ 0.999,
30
+ )
31
+ custom_hooks = [
32
+ dict(
33
+ tokenizer=dict(
34
+ padding_side='right',
35
+ pretrained_model_name_or_path=
36
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48',
37
+ trust_remote_code=True,
38
+ type='transformers.AutoTokenizer.from_pretrained'),
39
+ type='xtuner.engine.hooks.DatasetInfoHook'),
40
+ dict(
41
+ evaluation_inputs=[
42
+ 'O que é um bode?',
43
+ 'Qual a capital da França?',
44
+ 'Você pode me explicar o Teorema de Pitágoras com um exemplo, por favor?',
45
+ 'Olá, tudo bem? Estou procurando livros de ficção científica para ler, você teria sugestões para mim?',
46
+ 'Resolva a equação de segundo grau x² - x - 30 = 0',
47
+ 'Escreva um código em python para calcular x^y usando divisão e conquista.',
48
+ ],
49
+ every_n_iters=500,
50
+ prompt_template='xtuner.utils.PROMPT_TEMPLATE.gemma',
51
+ system='xtuner.utils.SYSTEM_TEMPLATE.alpaca',
52
+ tokenizer=dict(
53
+ padding_side='right',
54
+ pretrained_model_name_or_path=
55
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48',
56
+ trust_remote_code=True,
57
+ type='transformers.AutoTokenizer.from_pretrained'),
58
+ type='xtuner.engine.hooks.EvaluateChatHook'),
59
+ ]
60
+ dataloader_num_workers = 0
61
+ default_hooks = dict(
62
+ checkpoint=dict(
63
+ by_epoch=False,
64
+ interval=500,
65
+ max_keep_ckpts=2,
66
+ type='mmengine.hooks.CheckpointHook'),
67
+ logger=dict(
68
+ interval=10,
69
+ log_metric_by_epoch=False,
70
+ type='mmengine.hooks.LoggerHook'),
71
+ param_scheduler=dict(type='mmengine.hooks.ParamSchedulerHook'),
72
+ sampler_seed=dict(type='mmengine.hooks.DistSamplerSeedHook'),
73
+ timer=dict(type='mmengine.hooks.IterTimerHook'))
74
+ env_cfg = dict(
75
+ cudnn_benchmark=False,
76
+ dist_cfg=dict(backend='nccl'),
77
+ mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
78
+ evaluation_freq = 500
79
+ evaluation_inputs = [
80
+ 'O que é um bode?',
81
+ 'Qual a capital da França?',
82
+ 'Você pode me explicar o Teorema de Pitágoras com um exemplo, por favor?',
83
+ 'Olá, tudo bem? Estou procurando livros de ficção científica para ler, você teria sugestões para mim?',
84
+ 'Resolva a equação de segundo grau x² - x - 30 = 0',
85
+ 'Escreva um código em python para calcular x^y usando divisão e conquista.',
86
+ ]
87
+ launcher = 'pytorch'
88
+ load_from = None
89
+ log_level = 'INFO'
90
+ log_processor = dict(by_epoch=False)
91
+ lr = 0.0002
92
+ max_epochs = 1
93
+ max_length = 2048
94
+ max_norm = 1
95
+ model = dict(
96
+ llm=dict(
97
+ pretrained_model_name_or_path=
98
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48',
99
+ quantization_config=dict(
100
+ bnb_4bit_compute_dtype='torch.float16',
101
+ bnb_4bit_quant_type='nf4',
102
+ bnb_4bit_use_double_quant=True,
103
+ llm_int8_has_fp16_weight=False,
104
+ llm_int8_threshold=6.0,
105
+ load_in_4bit=True,
106
+ load_in_8bit=False,
107
+ type='transformers.BitsAndBytesConfig'),
108
+ torch_dtype='torch.float16',
109
+ trust_remote_code=True,
110
+ type='transformers.AutoModelForCausalLM.from_pretrained'),
111
+ lora=dict(
112
+ bias='none',
113
+ lora_alpha=16,
114
+ lora_dropout=0.1,
115
+ r=64,
116
+ task_type='CAUSAL_LM',
117
+ type='peft.LoraConfig'),
118
+ type='xtuner.model.SupervisedFinetune',
119
+ use_varlen_attn=False)
120
+ optim_type = 'torch.optim.AdamW'
121
+ optim_wrapper = dict(
122
+ optimizer=dict(
123
+ betas=(
124
+ 0.9,
125
+ 0.999,
126
+ ),
127
+ lr=0.0002,
128
+ type='torch.optim.AdamW',
129
+ weight_decay=0),
130
+ type='DeepSpeedOptimWrapper')
131
+ pack_to_max_length = True
132
+ param_scheduler = [
133
+ dict(
134
+ begin=0,
135
+ by_epoch=True,
136
+ convert_to_iter_based=True,
137
+ end=0.03,
138
+ start_factor=1e-05,
139
+ type='mmengine.optim.LinearLR'),
140
+ dict(
141
+ begin=0.03,
142
+ by_epoch=True,
143
+ convert_to_iter_based=True,
144
+ end=1,
145
+ eta_min=0.0,
146
+ type='mmengine.optim.CosineAnnealingLR'),
147
+ ]
148
+ pretrained_model_name_or_path = '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48'
149
+ prompt_template = 'xtuner.utils.PROMPT_TEMPLATE.gemma'
150
+ randomness = dict(deterministic=False, seed=None)
151
+ resume = False
152
+ runner_type = 'FlexibleRunner'
153
+ save_steps = 500
154
+ save_total_limit = 2
155
+ strategy = dict(
156
+ config=dict(
157
+ bf16=dict(enabled=False),
158
+ fp16=dict(enabled=True, initial_scale_power=16),
159
+ gradient_accumulation_steps='auto',
160
+ gradient_clipping='auto',
161
+ train_micro_batch_size_per_gpu='auto',
162
+ zero_allow_untested_optimizer=True,
163
+ zero_force_ds_cpu_optimizer=False,
164
+ zero_optimization=dict(overlap_comm=True, stage=2)),
165
+ exclude_frozen_parameters=True,
166
+ gradient_accumulation_steps=16,
167
+ gradient_clipping=1,
168
+ sequence_parallel_size=1,
169
+ train_micro_batch_size_per_gpu=2,
170
+ type='xtuner.engine.DeepSpeedStrategy')
171
+ tokenizer = dict(
172
+ padding_side='right',
173
+ pretrained_model_name_or_path=
174
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48',
175
+ trust_remote_code=True,
176
+ type='transformers.AutoTokenizer.from_pretrained')
177
+ train_cfg = dict(max_epochs=1, type='xtuner.engine.runner.TrainLoop')
178
+ train_dataloader = dict(
179
+ batch_size=2,
180
+ collate_fn=dict(
181
+ type='xtuner.dataset.collate_fns.default_collate_fn',
182
+ use_varlen_attn=False),
183
+ dataset=dict(
184
+ dataset=dict(
185
+ data_files=
186
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/datasets--recogna-nlp--ultra-alpaca-ptbr/snapshots/e69900d074177d370a911096fc30bdf407eff666/train.json',
187
+ path='json',
188
+ type='datasets.load_dataset'),
189
+ dataset_map_fn='xtuner.dataset.map_fns.ultracabrita_map_fn',
190
+ max_length=2048,
191
+ pack_to_max_length=True,
192
+ remove_unused_columns=True,
193
+ shuffle_before_pack=True,
194
+ template_map_fn=dict(
195
+ template='xtuner.utils.PROMPT_TEMPLATE.gemma',
196
+ type='xtuner.dataset.map_fns.template_map_fn_factory'),
197
+ tokenizer=dict(
198
+ padding_side='right',
199
+ pretrained_model_name_or_path=
200
+ '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-2b-it/snapshots/de144fb2268dee1066f515465df532c05e699d48',
201
+ trust_remote_code=True,
202
+ type='transformers.AutoTokenizer.from_pretrained'),
203
+ type='xtuner.dataset.process_hf_dataset',
204
+ use_varlen_attn=False),
205
+ num_workers=0,
206
+ sampler=dict(shuffle=True, type='mmengine.dataset.DefaultSampler'))
207
+ use_varlen_attn = False
208
+ visualizer = None
209
+ warmup_ratio = 0.03
210
+ weight_decay = 0
211
+ work_dir = './work_dirs/gemma_2b_it_qlora_ultracabrita'