lukahh commited on
Commit
0628a82
·
verified ·
1 Parent(s): c5ecef1

Upload merged LoRA model

Browse files
README.md CHANGED
@@ -1,56 +1,58 @@
1
- ---
2
- library_name: peft
3
- base_model: openai/clip-vit-base-patch32
4
- tags:
5
- - generated_from_trainer
6
- model-index:
7
- - name: cultureclip_lora_100k_0317_32_07_03
8
- results: []
9
- ---
10
 
11
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
12
- should probably proofread and complete it, then remove this comment. -->
13
-
14
- # cultureclip_lora_100k_0317_32_07_03
15
-
16
- This model is a fine-tuned version of [openai/clip-vit-base-patch32](https://huggingface.co/openai/clip-vit-base-patch32) on an unknown dataset.
17
-
18
- ## Model description
19
-
20
- More information needed
21
-
22
- ## Intended uses & limitations
23
-
24
- More information needed
25
-
26
- ## Training and evaluation data
27
-
28
- More information needed
29
-
30
- ## Training procedure
31
-
32
- ### Training hyperparameters
33
-
34
- The following hyperparameters were used during training:
35
- - learning_rate: 3e-06
36
- - train_batch_size: 128
37
- - eval_batch_size: 8
38
- - seed: 42
39
- - gradient_accumulation_steps: 16
40
- - total_train_batch_size: 2048
41
- - optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
42
- - lr_scheduler_type: linear
43
- - lr_scheduler_warmup_steps: 100
44
- - num_epochs: 10.0
45
-
46
- ### Training results
47
-
48
-
49
-
50
- ### Framework versions
51
-
52
- - PEFT 0.14.1.dev0
53
- - Transformers 4.49.0
54
- - Pytorch 2.5.1+cu124
55
- - Datasets 3.2.0
56
- - Tokenizers 0.21.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ # CultureCLIP模型(LoRA微调)
3
+
4
+ 此模型是使用LoRA方法微调的CLIP模型,已合并LoRA权重到基础模型中。
5
+
6
+ ## 模型详情
7
+
8
+ - **基础模型**: openai/clip-vit-base-patch32
9
+ - **任务**: 对比学习图像-文本匹配
10
+ - **训练参数**:
11
+ - 批次大小: 128
12
+ - 学习率: 3e-06
13
+ - 训练轮数: 10.0
14
+ - 梯度累积步数: 16
15
+ - 损失函数: cultureclip
16
+ - Caption损失权重: 0.7
17
+ - Context损失权重: 0.3
18
+
19
+ ## LoRA配置
20
+ - LoRA秩(r): 4
21
+ - LoRA Alpha: 16
22
+ - LoRA Dropout: 0.1
23
+ - 应用到视觉模型: True
24
+ - 应用到文本模型: True
25
+ - 目标位置: all
26
+ - 目标参数: qv
27
+ - 骨干网络: ViT-B/32
28
+
29
+ ## 冻结设置
30
+ - 冻结视觉模型: False
31
+ - 冻结文本模型: False
32
+
33
+ ## 数据集信息
34
+ - 训练文件: /data/yuchen/CultureCLIP_data/pos_neg_crope/train_100k.jsonl
35
+ - 验证文件: /data/yuchen/CultureCLIP_data/pos_neg_crope/val_100k.jsonl
36
+ - 最大序列长度: 77
37
+ - 使用多输入对比学习: True
38
+
39
+ ## 使用方法
40
+
41
+ ```python
42
+ from transformers import CLIPModel, CLIPProcessor
43
+
44
+ # 加载模型和处理器
45
+ model = CLIPModel.from_pretrained("None")
46
+ processor = CLIPProcessor.from_pretrained("None")
47
+
48
+ # 处理文本和图像
49
+ inputs = processor(
50
+ text=["一张猫的照片", "一张狗的照片"],
51
+ images=image,
52
+ return_tensors="pt",
53
+ padding=True
54
+ )
55
+
56
+ # 获取输出
57
+ outputs = model(**inputs)
58
+ ```
config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "openai/clip-vit-base-patch32",
3
+ "architectures": [
4
+ "CLIPModel"
5
+ ],
6
+ "initializer_factor": 1.0,
7
+ "logit_scale_init_value": 2.6592,
8
+ "model_type": "clip",
9
+ "projection_dim": 512,
10
+ "text_config": {
11
+ "bos_token_id": 0,
12
+ "dropout": 0.0,
13
+ "eos_token_id": 2,
14
+ "model_type": "clip_text_model",
15
+ "torch_dtype": "float32"
16
+ },
17
+ "torch_dtype": "float32",
18
+ "transformers_version": "4.49.0",
19
+ "vision_config": {
20
+ "dropout": 0.0,
21
+ "model_type": "clip_vision_model",
22
+ "torch_dtype": "float32"
23
+ }
24
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dde8e98a3e5d2f32d1c954e9dc1e88a5e37a0b95b3418f159339dbd2064e469a
3
+ size 605156676
preprocessor_config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "crop_size": {
3
+ "height": 224,
4
+ "width": 224
5
+ },
6
+ "do_center_crop": true,
7
+ "do_convert_rgb": true,
8
+ "do_normalize": true,
9
+ "do_rescale": true,
10
+ "do_resize": true,
11
+ "image_mean": [
12
+ 0.48145466,
13
+ 0.4578275,
14
+ 0.40821073
15
+ ],
16
+ "image_processor_type": "CLIPImageProcessor",
17
+ "image_std": [
18
+ 0.26862954,
19
+ 0.26130258,
20
+ 0.27577711
21
+ ],
22
+ "processor_class": "CLIPProcessor",
23
+ "resample": 3,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "shortest_edge": 224
27
+ }
28
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<|startoftext|>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "<|endoftext|>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "<|endoftext|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "unk_token": {
24
+ "content": "<|endoftext|>",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ }
30
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "49406": {
5
+ "content": "<|startoftext|>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "49407": {
13
+ "content": "<|endoftext|>",
14
+ "lstrip": false,
15
+ "normalized": false,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ }
20
+ },
21
+ "bos_token": "<|startoftext|>",
22
+ "clean_up_tokenization_spaces": false,
23
+ "do_lower_case": true,
24
+ "eos_token": "<|endoftext|>",
25
+ "errors": "replace",
26
+ "extra_special_tokens": {},
27
+ "model_max_length": 77,
28
+ "pad_token": "<|endoftext|>",
29
+ "processor_class": "CLIPProcessor",
30
+ "tokenizer_class": "CLIPTokenizer",
31
+ "unk_token": "<|endoftext|>"
32
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff