Image-Text-to-Text
Safetensors
xtuner
LZHgrla commited on
Commit
2a22d7b
1 Parent(s): 232a755

Delete xtuner_config.py

Browse files
Files changed (1) hide show
  1. xtuner_config.py +0 -208
xtuner_config.py DELETED
@@ -1,208 +0,0 @@
1
- SYSTEM = ''
2
- accumulative_counts = 1
3
- batch_size = 16
4
- betas = (
5
- 0.9,
6
- 0.999,
7
- )
8
- custom_hooks = [
9
- dict(
10
- tokenizer=dict(
11
- padding_side='right',
12
- pretrained_model_name_or_path='internlm/internlm2-chat-7b',
13
- trust_remote_code=True,
14
- type='transformers.AutoTokenizer.from_pretrained'),
15
- type='xtuner.engine.DatasetInfoHook'),
16
- dict(
17
- evaluation_images='https://llava-vl.github.io/static/images/view.jpg',
18
- evaluation_inputs=[
19
- '请描述一下这张照片',
20
- 'Please describe this picture',
21
- ],
22
- every_n_iters=500,
23
- image_processor=dict(
24
- pretrained_model_name_or_path='openai/clip-vit-large-patch14-336',
25
- trust_remote_code=True,
26
- type='transformers.CLIPImageProcessor.from_pretrained'),
27
- prompt_template='xtuner.utils.PROMPT_TEMPLATE.internlm2_chat',
28
- system='',
29
- tokenizer=dict(
30
- padding_side='right',
31
- pretrained_model_name_or_path='internlm/internlm2-chat-7b',
32
- trust_remote_code=True,
33
- type='transformers.AutoTokenizer.from_pretrained'),
34
- type='xtuner.engine.EvaluateChatHook'),
35
- ]
36
- data_path = './data/llava_data/LLaVA-Instruct-150K/llava_v1_5_mix665k.json'
37
- data_root = './data/llava_data/'
38
- dataloader_num_workers = 0
39
- default_hooks = dict(
40
- checkpoint=dict(interval=1, type='mmengine.hooks.CheckpointHook'),
41
- logger=dict(interval=10, type='mmengine.hooks.LoggerHook'),
42
- param_scheduler=dict(type='mmengine.hooks.ParamSchedulerHook'),
43
- sampler_seed=dict(type='mmengine.hooks.DistSamplerSeedHook'),
44
- timer=dict(type='mmengine.hooks.IterTimerHook'))
45
- env_cfg = dict(
46
- cudnn_benchmark=False,
47
- dist_cfg=dict(backend='nccl'),
48
- mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
49
- evaluation_freq = 500
50
- evaluation_images = 'https://llava-vl.github.io/static/images/view.jpg'
51
- evaluation_inputs = [
52
- '请描述一下这张照片',
53
- 'Please describe this picture',
54
- ]
55
- image_folder = './data/llava_data/llava_images'
56
- image_processor = dict(
57
- pretrained_model_name_or_path='openai/clip-vit-large-patch14-336',
58
- trust_remote_code=True,
59
- type='transformers.CLIPImageProcessor.from_pretrained')
60
- launcher = 'pytorch'
61
- llava_dataset = dict(
62
- data_path='./data/llava_data/LLaVA-Instruct-150K/llava_v1_5_mix665k.json',
63
- dataset_map_fn='xtuner.dataset.map_fns.llava_map_fn',
64
- image_folder='./data/llava_data/llava_images',
65
- image_processor=dict(
66
- pretrained_model_name_or_path='openai/clip-vit-large-patch14-336',
67
- trust_remote_code=True,
68
- type='transformers.CLIPImageProcessor.from_pretrained'),
69
- max_length=1472,
70
- pad_image_to_square=True,
71
- template_map_fn=dict(
72
- template='xtuner.utils.PROMPT_TEMPLATE.internlm2_chat',
73
- type='xtuner.dataset.map_fns.template_map_fn_factory'),
74
- tokenizer=dict(
75
- padding_side='right',
76
- pretrained_model_name_or_path='internlm/internlm2-chat-7b',
77
- trust_remote_code=True,
78
- type='transformers.AutoTokenizer.from_pretrained'),
79
- type='xtuner.dataset.LLaVADataset')
80
- llm_name_or_path = 'internlm/internlm2-chat-7b'
81
- load_from = None
82
- log_level = 'INFO'
83
- lr = 0.0002
84
- max_epochs = 1
85
- max_length = 1472
86
- max_norm = 1
87
- model = dict(
88
- freeze_llm=True,
89
- freeze_visual_encoder=True,
90
- llm=dict(
91
- pretrained_model_name_or_path='internlm/internlm2-chat-7b',
92
- quantization_config=dict(
93
- bnb_4bit_compute_dtype='torch.float16',
94
- bnb_4bit_quant_type='nf4',
95
- bnb_4bit_use_double_quant=True,
96
- llm_int8_has_fp16_weight=False,
97
- llm_int8_threshold=6.0,
98
- load_in_4bit=True,
99
- load_in_8bit=False,
100
- type='transformers.BitsAndBytesConfig'),
101
- torch_dtype='torch.float16',
102
- trust_remote_code=True,
103
- type='transformers.AutoModelForCausalLM.from_pretrained'),
104
- llm_lora=dict(
105
- bias='none',
106
- lora_alpha=256,
107
- lora_dropout=0.05,
108
- r=512,
109
- task_type='CAUSAL_LM',
110
- type='peft.LoraConfig'),
111
- pretrained_pth=
112
- './work_dirs/llava_internlm2_chat_7b_clip_vit_large_p14_336_e1_gpu8_pretrain/epoch_1.pth',
113
- type='xtuner.model.LLaVAModel',
114
- visual_encoder=dict(
115
- pretrained_model_name_or_path='openai/clip-vit-large-patch14-336',
116
- type='transformers.CLIPVisionModel.from_pretrained'),
117
- visual_encoder_lora=dict(
118
- bias='none',
119
- lora_alpha=16,
120
- lora_dropout=0.05,
121
- r=64,
122
- type='peft.LoraConfig'))
123
- optim_type = 'torch.optim.AdamW'
124
- optim_wrapper = dict(
125
- optimizer=dict(
126
- betas=(
127
- 0.9,
128
- 0.999,
129
- ),
130
- lr=0.0002,
131
- type='torch.optim.AdamW',
132
- weight_decay=0),
133
- type='DeepSpeedOptimWrapper')
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
- T_max=1,
144
- begin=0.03,
145
- by_epoch=True,
146
- convert_to_iter_based=True,
147
- eta_min=0.0,
148
- type='mmengine.optim.CosineAnnealingLR'),
149
- ]
150
- pretrained_pth = './work_dirs/llava_internlm2_chat_7b_clip_vit_large_p14_336_e1_gpu8_pretrain/epoch_1.pth'
151
- prompt_template = 'xtuner.utils.PROMPT_TEMPLATE.internlm2_chat'
152
- randomness = dict(deterministic=False, seed=None)
153
- resume = False
154
- runner_type = 'FlexibleRunner'
155
- strategy = dict(
156
- config=dict(
157
- bf16=dict(enabled=True),
158
- fp16=dict(enabled=False, 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=1,
167
- gradient_clipping=1,
168
- train_micro_batch_size_per_gpu=16,
169
- type='xtuner.engine.DeepSpeedStrategy')
170
- tokenizer = dict(
171
- padding_side='right',
172
- pretrained_model_name_or_path='internlm/internlm2-chat-7b',
173
- trust_remote_code=True,
174
- type='transformers.AutoTokenizer.from_pretrained')
175
- train_cfg = dict(by_epoch=True, max_epochs=1, val_interval=1)
176
- train_dataloader = dict(
177
- batch_size=16,
178
- collate_fn=dict(type='xtuner.dataset.collate_fns.default_collate_fn'),
179
- dataset=dict(
180
- data_path=
181
- './data/llava_data/LLaVA-Instruct-150K/llava_v1_5_mix665k.json',
182
- dataset_map_fn='xtuner.dataset.map_fns.llava_map_fn',
183
- image_folder='./data/llava_data/llava_images',
184
- image_processor=dict(
185
- pretrained_model_name_or_path='openai/clip-vit-large-patch14-336',
186
- trust_remote_code=True,
187
- type='transformers.CLIPImageProcessor.from_pretrained'),
188
- max_length=1472,
189
- pad_image_to_square=True,
190
- template_map_fn=dict(
191
- template='xtuner.utils.PROMPT_TEMPLATE.internlm2_chat',
192
- type='xtuner.dataset.map_fns.template_map_fn_factory'),
193
- tokenizer=dict(
194
- padding_side='right',
195
- pretrained_model_name_or_path='internlm/internlm2-chat-7b',
196
- trust_remote_code=True,
197
- type='transformers.AutoTokenizer.from_pretrained'),
198
- type='xtuner.dataset.LLaVADataset'),
199
- num_workers=0,
200
- sampler=dict(
201
- length_property='modality_length',
202
- per_device_batch_size=16,
203
- type='xtuner.dataset.samplers.LengthGroupedSampler'))
204
- visual_encoder_name_or_path = 'openai/clip-vit-large-patch14-336'
205
- visualizer = None
206
- warmup_ratio = 0.03
207
- weight_decay = 0
208
- work_dir = './work_dirs/llava_internlm2_chat_7b_qlora_clip_vit_large_p14_336_lora_e1_gpu8_finetune'