Upload folder using huggingface_hub
Browse files- README.md +22 -1
- adapter_config.json +26 -0
- adapter_model.bin +3 -0
- xtuner_config.py +212 -0
README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 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-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf",
|
| 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 |
+
"o_proj",
|
| 18 |
+
"k_proj",
|
| 19 |
+
"v_proj",
|
| 20 |
+
"down_proj",
|
| 21 |
+
"q_proj",
|
| 22 |
+
"gate_proj",
|
| 23 |
+
"up_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:6f28f3449bb27e3ddb0fccdd901984bcd93270c4ae953b03785b4eb4f7639658
|
| 3 |
+
size 400173482
|
xtuner_config.py
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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, honesto e inofensivo.\n - O GemBode pode entender e se comunicar fluentemente na linguagem escolhida pelo usuário, em especial o Português e o Inglês'
|
| 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.default',
|
| 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-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf',
|
| 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-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf',
|
| 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.default',
|
| 51 |
+
system=
|
| 52 |
+
'Você é assistente de IA chamado GemBode.\n - O GemBode é um modelo de língua conversacional projetado para ser prestativo, honesto e inofensivo.\n - O GemBode pode entender e se comunicar fluentemente na linguagem escolhida pelo usuário, em especial o Português e o Inglês',
|
| 53 |
+
tokenizer=dict(
|
| 54 |
+
padding_side='right',
|
| 55 |
+
pretrained_model_name_or_path=
|
| 56 |
+
'/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf',
|
| 57 |
+
trust_remote_code=True,
|
| 58 |
+
type='transformers.AutoTokenizer.from_pretrained'),
|
| 59 |
+
type='xtuner.engine.hooks.EvaluateChatHook'),
|
| 60 |
+
]
|
| 61 |
+
dataloader_num_workers = 0
|
| 62 |
+
default_hooks = dict(
|
| 63 |
+
checkpoint=dict(
|
| 64 |
+
by_epoch=False,
|
| 65 |
+
interval=500,
|
| 66 |
+
max_keep_ckpts=2,
|
| 67 |
+
type='mmengine.hooks.CheckpointHook'),
|
| 68 |
+
logger=dict(
|
| 69 |
+
interval=10,
|
| 70 |
+
log_metric_by_epoch=False,
|
| 71 |
+
type='mmengine.hooks.LoggerHook'),
|
| 72 |
+
param_scheduler=dict(type='mmengine.hooks.ParamSchedulerHook'),
|
| 73 |
+
sampler_seed=dict(type='mmengine.hooks.DistSamplerSeedHook'),
|
| 74 |
+
timer=dict(type='mmengine.hooks.IterTimerHook'))
|
| 75 |
+
env_cfg = dict(
|
| 76 |
+
cudnn_benchmark=False,
|
| 77 |
+
dist_cfg=dict(backend='nccl'),
|
| 78 |
+
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
|
| 79 |
+
evaluation_freq = 500
|
| 80 |
+
evaluation_inputs = [
|
| 81 |
+
'O que é um bode?',
|
| 82 |
+
'Qual a capital da França?',
|
| 83 |
+
'Você pode me explicar o Teorema de Pitágoras com um exemplo, por favor?',
|
| 84 |
+
'Olá, tudo bem? Estou procurando livros de ficção científica para ler, você teria sugestões para mim?',
|
| 85 |
+
'Resolva a equação de segundo grau x² - x - 30 = 0',
|
| 86 |
+
'Escreva um código em python para calcular x^y usando divisão e conquista.',
|
| 87 |
+
]
|
| 88 |
+
launcher = 'pytorch'
|
| 89 |
+
load_from = None
|
| 90 |
+
log_level = 'INFO'
|
| 91 |
+
log_processor = dict(by_epoch=False)
|
| 92 |
+
lr = 0.0002
|
| 93 |
+
max_epochs = 1
|
| 94 |
+
max_length = 2048
|
| 95 |
+
max_norm = 1
|
| 96 |
+
model = dict(
|
| 97 |
+
llm=dict(
|
| 98 |
+
pretrained_model_name_or_path=
|
| 99 |
+
'/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf',
|
| 100 |
+
quantization_config=dict(
|
| 101 |
+
bnb_4bit_compute_dtype='torch.float16',
|
| 102 |
+
bnb_4bit_quant_type='nf4',
|
| 103 |
+
bnb_4bit_use_double_quant=True,
|
| 104 |
+
llm_int8_has_fp16_weight=False,
|
| 105 |
+
llm_int8_threshold=6.0,
|
| 106 |
+
load_in_4bit=True,
|
| 107 |
+
load_in_8bit=False,
|
| 108 |
+
type='transformers.BitsAndBytesConfig'),
|
| 109 |
+
torch_dtype='torch.float16',
|
| 110 |
+
trust_remote_code=True,
|
| 111 |
+
type='transformers.AutoModelForCausalLM.from_pretrained'),
|
| 112 |
+
lora=dict(
|
| 113 |
+
bias='none',
|
| 114 |
+
lora_alpha=16,
|
| 115 |
+
lora_dropout=0.1,
|
| 116 |
+
r=64,
|
| 117 |
+
task_type='CAUSAL_LM',
|
| 118 |
+
type='peft.LoraConfig'),
|
| 119 |
+
type='xtuner.model.SupervisedFinetune',
|
| 120 |
+
use_varlen_attn=False)
|
| 121 |
+
optim_type = 'torch.optim.AdamW'
|
| 122 |
+
optim_wrapper = dict(
|
| 123 |
+
optimizer=dict(
|
| 124 |
+
betas=(
|
| 125 |
+
0.9,
|
| 126 |
+
0.999,
|
| 127 |
+
),
|
| 128 |
+
lr=0.0002,
|
| 129 |
+
type='torch.optim.AdamW',
|
| 130 |
+
weight_decay=0),
|
| 131 |
+
type='DeepSpeedOptimWrapper')
|
| 132 |
+
pack_to_max_length = True
|
| 133 |
+
param_scheduler = [
|
| 134 |
+
dict(
|
| 135 |
+
begin=0,
|
| 136 |
+
by_epoch=True,
|
| 137 |
+
convert_to_iter_based=True,
|
| 138 |
+
end=0.03,
|
| 139 |
+
start_factor=1e-05,
|
| 140 |
+
type='mmengine.optim.LinearLR'),
|
| 141 |
+
dict(
|
| 142 |
+
begin=0.03,
|
| 143 |
+
by_epoch=True,
|
| 144 |
+
convert_to_iter_based=True,
|
| 145 |
+
end=1,
|
| 146 |
+
eta_min=0.0,
|
| 147 |
+
type='mmengine.optim.CosineAnnealingLR'),
|
| 148 |
+
]
|
| 149 |
+
pretrained_model_name_or_path = '/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf'
|
| 150 |
+
prompt_template = 'xtuner.utils.PROMPT_TEMPLATE.default'
|
| 151 |
+
randomness = dict(deterministic=False, seed=None)
|
| 152 |
+
resume = False
|
| 153 |
+
runner_type = 'FlexibleRunner'
|
| 154 |
+
save_steps = 500
|
| 155 |
+
save_total_limit = 2
|
| 156 |
+
strategy = dict(
|
| 157 |
+
config=dict(
|
| 158 |
+
bf16=dict(enabled=False),
|
| 159 |
+
fp16=dict(enabled=True, initial_scale_power=16),
|
| 160 |
+
gradient_accumulation_steps='auto',
|
| 161 |
+
gradient_clipping='auto',
|
| 162 |
+
train_micro_batch_size_per_gpu='auto',
|
| 163 |
+
zero_allow_untested_optimizer=True,
|
| 164 |
+
zero_force_ds_cpu_optimizer=False,
|
| 165 |
+
zero_optimization=dict(overlap_comm=True, stage=2)),
|
| 166 |
+
exclude_frozen_parameters=True,
|
| 167 |
+
gradient_accumulation_steps=16,
|
| 168 |
+
gradient_clipping=1,
|
| 169 |
+
sequence_parallel_size=1,
|
| 170 |
+
train_micro_batch_size_per_gpu=2,
|
| 171 |
+
type='xtuner.engine.DeepSpeedStrategy')
|
| 172 |
+
tokenizer = dict(
|
| 173 |
+
padding_side='right',
|
| 174 |
+
pretrained_model_name_or_path=
|
| 175 |
+
'/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf',
|
| 176 |
+
trust_remote_code=True,
|
| 177 |
+
type='transformers.AutoTokenizer.from_pretrained')
|
| 178 |
+
train_cfg = dict(max_epochs=1, type='xtuner.engine.runner.TrainLoop')
|
| 179 |
+
train_dataloader = dict(
|
| 180 |
+
batch_size=2,
|
| 181 |
+
collate_fn=dict(
|
| 182 |
+
type='xtuner.dataset.collate_fns.default_collate_fn',
|
| 183 |
+
use_varlen_attn=False),
|
| 184 |
+
dataset=dict(
|
| 185 |
+
dataset=dict(
|
| 186 |
+
data_files=
|
| 187 |
+
'/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/datasets--recogna-nlp--ultra-alpaca-ptbr/snapshots/e69900d074177d370a911096fc30bdf407eff666/train.json',
|
| 188 |
+
path='json',
|
| 189 |
+
type='datasets.load_dataset'),
|
| 190 |
+
dataset_map_fn='xtuner.dataset.map_fns.ultracabrita_map_fn',
|
| 191 |
+
max_length=2048,
|
| 192 |
+
pack_to_max_length=True,
|
| 193 |
+
remove_unused_columns=True,
|
| 194 |
+
shuffle_before_pack=True,
|
| 195 |
+
template_map_fn=dict(
|
| 196 |
+
template='xtuner.utils.PROMPT_TEMPLATE.default',
|
| 197 |
+
type='xtuner.dataset.map_fns.template_map_fn_factory'),
|
| 198 |
+
tokenizer=dict(
|
| 199 |
+
padding_side='right',
|
| 200 |
+
pretrained_model_name_or_path=
|
| 201 |
+
'/petrobr/parceirosbr/home/rafael.rodrigues/.cache/huggingface/hub/models--google--gemma-7b/snapshots/c0be85690a0385f5990b14826ff530f199a5cdcf',
|
| 202 |
+
trust_remote_code=True,
|
| 203 |
+
type='transformers.AutoTokenizer.from_pretrained'),
|
| 204 |
+
type='xtuner.dataset.process_hf_dataset',
|
| 205 |
+
use_varlen_attn=False),
|
| 206 |
+
num_workers=0,
|
| 207 |
+
sampler=dict(shuffle=True, type='mmengine.dataset.DefaultSampler'))
|
| 208 |
+
use_varlen_attn = False
|
| 209 |
+
visualizer = None
|
| 210 |
+
warmup_ratio = 0.03
|
| 211 |
+
weight_decay = 0
|
| 212 |
+
work_dir = './work_dirs/gemma_7b_qlora_ultraalpaca'
|