PEFT
phpaiola commited on
Commit
c0678f8
1 Parent(s): 439a334

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +202 -3
  2. adapter_config.json +33 -0
  3. adapter_model.bin +3 -0
  4. xtuner_config.py +213 -0
README.md CHANGED
@@ -1,3 +1,202 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: peft
3
+ base_model: recogna-nlp/internlm-chatbode-7b
4
+ ---
5
+
6
+ # Model Card for Model ID
7
+
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
+
10
+
11
+
12
+ ## Model Details
13
+
14
+ ### Model Description
15
+
16
+ <!-- Provide a longer summary of what this model is. -->
17
+
18
+
19
+
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
+
28
+ ### Model Sources [optional]
29
+
30
+ <!-- Provide the basic links for the model. -->
31
+
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
+
36
+ ## Uses
37
+
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
+
40
+ ### Direct Use
41
+
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
+
44
+ [More Information Needed]
45
+
46
+ ### Downstream Use [optional]
47
+
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
+
50
+ [More Information Needed]
51
+
52
+ ### Out-of-Scope Use
53
+
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
+
56
+ [More Information Needed]
57
+
58
+ ## Bias, Risks, and Limitations
59
+
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
+
62
+ [More Information Needed]
63
+
64
+ ### Recommendations
65
+
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
+
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
+
70
+ ## How to Get Started with the Model
71
+
72
+ Use the code below to get started with the model.
73
+
74
+ [More Information Needed]
75
+
76
+ ## Training Details
77
+
78
+ ### Training Data
79
+
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
+
82
+ [More Information Needed]
83
+
84
+ ### Training Procedure
85
+
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
+
88
+ #### Preprocessing [optional]
89
+
90
+ [More Information Needed]
91
+
92
+
93
+ #### Training Hyperparameters
94
+
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
+
97
+ #### Speeds, Sizes, Times [optional]
98
+
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
+
101
+ [More Information Needed]
102
+
103
+ ## Evaluation
104
+
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
+
107
+ ### Testing Data, Factors & Metrics
108
+
109
+ #### Testing Data
110
+
111
+ <!-- This should link to a Dataset Card if possible. -->
112
+
113
+ [More Information Needed]
114
+
115
+ #### Factors
116
+
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
+
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
200
+ ### Framework versions
201
+
202
+ - PEFT 0.10.0
adapter_config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "alpha_pattern": {},
3
+ "auto_mapping": null,
4
+ "base_model_name_or_path": "recogna-nlp/internlm-chatbode-7b",
5
+ "bias": "none",
6
+ "fan_in_fan_out": false,
7
+ "inference_mode": true,
8
+ "init_lora_weights": true,
9
+ "layer_replication": null,
10
+ "layers_pattern": null,
11
+ "layers_to_transform": null,
12
+ "loftq_config": {},
13
+ "lora_alpha": 128,
14
+ "lora_dropout": 0.1,
15
+ "megatron_config": null,
16
+ "megatron_core": "megatron.core",
17
+ "modules_to_save": null,
18
+ "peft_type": "LORA",
19
+ "r": 256,
20
+ "rank_pattern": {},
21
+ "revision": null,
22
+ "target_modules": [
23
+ "w3",
24
+ "w1",
25
+ "w2",
26
+ "wqkv",
27
+ "wo",
28
+ "output"
29
+ ],
30
+ "task_type": "CAUSAL_LM",
31
+ "use_dora": false,
32
+ "use_rslora": false
33
+ }
adapter_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:90df51ff7510ecc3a8950f55ca3404e824b9921c04380d940c1f38f211a2bd2d
3
+ size 1257556050
xtuner_config.py ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SYSTEM = ''
2
+ accumulative_counts = 4
3
+ alpaca_en = dict(
4
+ dataset=dict(
5
+ data_files=
6
+ '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/datasets--recogna-nlp--drbode360_dataset/snapshots/43eda97b81a4bd797faa5e89163e8c47ee3cb2b6/train.json',
7
+ path='json',
8
+ type='datasets.load_dataset'),
9
+ dataset_map_fn='xtuner.dataset.map_fns.doctorbode_map_fn',
10
+ max_length=2048,
11
+ pack_to_max_length=False,
12
+ remove_unused_columns=True,
13
+ shuffle_before_pack=True,
14
+ template_map_fn=dict(
15
+ template='xtuner.utils.PROMPT_TEMPLATE.internlm2_chat',
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/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2',
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/luis.afonso/.cache/huggingface/hub/datasets--recogna-nlp--drbode360_dataset/snapshots/43eda97b81a4bd797faa5e89163e8c47ee3cb2b6/train.json'
26
+ batch_size = 3
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/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2',
37
+ trust_remote_code=True,
38
+ type='transformers.AutoTokenizer.from_pretrained'),
39
+ type='xtuner.engine.hooks.DatasetInfoHook'),
40
+ dict(
41
+ evaluation_inputs=[
42
+ 'Boa tarde. Fiz um exame e minha taxa de prolactina está acima do normal. Ainda vou passar no médico, mas gostaria de saber o que isso pode significar.',
43
+ 'Meu filho de 5 anos está com febre de 38 graus e manchas pelo corpo. Por favor, me diga o que pode ser e o que devo fazer.',
44
+ 'Quais as diferenças entre uma gripe e um resfriado comum?',
45
+ 'Quais os riscos de um tratamento incorreto com antibióticos?',
46
+ 'Você tem algum conhecimento sobre medicina?',
47
+ 'Quais são os principais hormônios femininos e quais suas funções?',
48
+ ],
49
+ every_n_iters=500,
50
+ max_new_tokens=2048,
51
+ prompt_template='xtuner.utils.PROMPT_TEMPLATE.internlm2_chat',
52
+ system='',
53
+ tokenizer=dict(
54
+ padding_side='right',
55
+ pretrained_model_name_or_path=
56
+ '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2',
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
+ 'Boa tarde. Fiz um exame e minha taxa de prolactina está acima do normal. Ainda vou passar no médico, mas gostaria de saber o que isso pode significar.',
82
+ 'Meu filho de 5 anos está com febre de 38 graus e manchas pelo corpo. Por favor, me diga o que pode ser e o que devo fazer.',
83
+ 'Quais as diferenças entre uma gripe e um resfriado comum?',
84
+ 'Quais os riscos de um tratamento incorreto com antibióticos?',
85
+ 'Você tem algum conhecimento sobre medicina?',
86
+ 'Quais são os principais hormônios femininos e quais suas funções?',
87
+ ]
88
+ launcher = 'pytorch'
89
+ load_from = 'work_dirs/internlm2_chat_7b_qlora_drbode/iter_23500.pth'
90
+ log_level = 'INFO'
91
+ log_processor = dict(by_epoch=False)
92
+ lr = 1e-05
93
+ max_epochs = 1
94
+ max_length = 2048
95
+ max_norm = 1
96
+ model = dict(
97
+ llm=dict(
98
+ attn_implementation='eager',
99
+ pretrained_model_name_or_path=
100
+ '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2',
101
+ quantization_config=dict(
102
+ bnb_4bit_compute_dtype='torch.float16',
103
+ bnb_4bit_quant_type='nf4',
104
+ bnb_4bit_use_double_quant=True,
105
+ llm_int8_has_fp16_weight=False,
106
+ llm_int8_threshold=6.0,
107
+ load_in_4bit=True,
108
+ load_in_8bit=False,
109
+ type='transformers.BitsAndBytesConfig'),
110
+ torch_dtype='torch.float16',
111
+ trust_remote_code=True,
112
+ type='transformers.AutoModelForCausalLM.from_pretrained'),
113
+ lora=dict(
114
+ bias='none',
115
+ lora_alpha=128,
116
+ lora_dropout=0.1,
117
+ r=256,
118
+ task_type='CAUSAL_LM',
119
+ type='peft.LoraConfig'),
120
+ type='xtuner.model.SupervisedFinetune',
121
+ use_varlen_attn=False)
122
+ optim_type = 'torch.optim.AdamW'
123
+ optim_wrapper = dict(
124
+ optimizer=dict(
125
+ betas=(
126
+ 0.9,
127
+ 0.999,
128
+ ),
129
+ lr=1e-05,
130
+ type='torch.optim.AdamW',
131
+ weight_decay=0),
132
+ type='DeepSpeedOptimWrapper')
133
+ pack_to_max_length = False
134
+ param_scheduler = [
135
+ dict(
136
+ begin=0,
137
+ by_epoch=True,
138
+ convert_to_iter_based=True,
139
+ end=0.03,
140
+ start_factor=1e-05,
141
+ type='mmengine.optim.LinearLR'),
142
+ dict(
143
+ begin=0.03,
144
+ by_epoch=True,
145
+ convert_to_iter_based=True,
146
+ end=1,
147
+ eta_min=0.0,
148
+ type='mmengine.optim.CosineAnnealingLR'),
149
+ ]
150
+ pretrained_model_name_or_path = '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2'
151
+ prompt_template = 'xtuner.utils.PROMPT_TEMPLATE.internlm2_chat'
152
+ randomness = dict(deterministic=False, seed=1975645176)
153
+ resume = True
154
+ runner_type = 'FlexibleRunner'
155
+ save_steps = 500
156
+ save_total_limit = 2
157
+ strategy = dict(
158
+ config=dict(
159
+ bf16=dict(enabled=False),
160
+ fp16=dict(enabled=True, initial_scale_power=16),
161
+ gradient_accumulation_steps='auto',
162
+ gradient_clipping='auto',
163
+ train_micro_batch_size_per_gpu='auto',
164
+ zero_allow_untested_optimizer=True,
165
+ zero_force_ds_cpu_optimizer=False,
166
+ zero_optimization=dict(overlap_comm=True, stage=2)),
167
+ exclude_frozen_parameters=True,
168
+ gradient_accumulation_steps=4,
169
+ gradient_clipping=1,
170
+ sequence_parallel_size=1,
171
+ train_micro_batch_size_per_gpu=3,
172
+ type='xtuner.engine.DeepSpeedStrategy')
173
+ tokenizer = dict(
174
+ padding_side='right',
175
+ pretrained_model_name_or_path=
176
+ '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2',
177
+ trust_remote_code=True,
178
+ type='transformers.AutoTokenizer.from_pretrained')
179
+ train_cfg = dict(max_epochs=1, type='xtuner.engine.runner.TrainLoop')
180
+ train_dataloader = dict(
181
+ batch_size=3,
182
+ collate_fn=dict(
183
+ type='xtuner.dataset.collate_fns.default_collate_fn',
184
+ use_varlen_attn=False),
185
+ dataset=dict(
186
+ dataset=dict(
187
+ data_files=
188
+ '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/datasets--recogna-nlp--drbode360_dataset/snapshots/43eda97b81a4bd797faa5e89163e8c47ee3cb2b6/train.json',
189
+ path='json',
190
+ type='datasets.load_dataset'),
191
+ dataset_map_fn='xtuner.dataset.map_fns.doctorbode_map_fn',
192
+ max_length=2048,
193
+ pack_to_max_length=False,
194
+ remove_unused_columns=True,
195
+ shuffle_before_pack=True,
196
+ template_map_fn=dict(
197
+ template='xtuner.utils.PROMPT_TEMPLATE.internlm2_chat',
198
+ type='xtuner.dataset.map_fns.template_map_fn_factory'),
199
+ tokenizer=dict(
200
+ padding_side='right',
201
+ pretrained_model_name_or_path=
202
+ '/petrobr/parceirosbr/home/luis.afonso/.cache/huggingface/hub/models--recogna-nlp--internlm-chatbode-7b/snapshots/b3acf1fa06aa64d49a6f725864316f35dcc885e2',
203
+ trust_remote_code=True,
204
+ type='transformers.AutoTokenizer.from_pretrained'),
205
+ type='xtuner.dataset.process_hf_dataset',
206
+ use_varlen_attn=False),
207
+ num_workers=0,
208
+ sampler=dict(shuffle=True, type='mmengine.dataset.DefaultSampler'))
209
+ use_varlen_attn = False
210
+ visualizer = None
211
+ warmup_ratio = 0.03
212
+ weight_decay = 0
213
+ work_dir = './work_dirs/internlm2_chat_7b_qlora_drbode'