morpheushoc commited on
Commit
dd58375
·
verified ·
1 Parent(s): fabc2aa

Upload InternVideo2_Classification_test

Browse files
config.json CHANGED
@@ -1,54 +1,52 @@
1
  {
2
- "_attn_implementation_autoset": true,
3
- "_name_or_path": "OpenGVLab/InternVideo2-Chat-8B",
 
4
  "auto_map": {
5
- "AutoConfig": "model_config.VideoChat2Config"
6
  },
7
- "model_config": {
8
- "bridge": {
9
- "extra_num_query_token": 64,
10
- "name": "qformer",
11
- "num_query_token": 32,
12
- "qformer_attention_probs_dropout_prob": 0.1,
13
- "qformer_drop_path_rate": 0.2,
14
- "qformer_hidden_dropout_prob": 0.1
15
- },
16
- "freeze_bridge": false,
17
- "freeze_llm": false,
18
- "freeze_vision_encoder": false,
19
- "llm": {
20
- "lora_alpha": 32,
21
- "lora_dropout": 0.1,
22
- "lora_r": 16,
23
- "name": "mistral_7b",
24
- "pretrained_llm_path": "mistralai/Mistral-7B-Instruct-v0.3",
25
- "use_lora": true
26
- },
27
- "loss": {
28
- "use_vision_regression_loss": false
29
- },
30
- "pretrained_paths": {},
31
- "use_flash_attention": true,
32
- "vision_encoder": {
33
- "checkpoint_num": 48,
34
- "d_model": 1408,
35
- "encoder_embed_dim": 1408,
36
- "img_size": 224,
37
- "name": "internvideo2-1B",
38
- "num_frames": 8,
39
- "origin_num_frames": 4,
40
- "patch_size": 14,
41
- "pretrained": null,
42
- "sep_image_video_pos_embed": true,
43
- "tubelet_size": 1,
44
- "use_checkpoint": true,
45
- "vit_add_ln": true,
46
- "x_vis_only": true,
47
- "x_vis_return_idx": -2
48
- }
49
  },
50
- "model_type": "InternVideo2_VideoChat2",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  "torch_dtype": "float32",
52
  "transformers_version": "4.46.1",
53
- "use_cache": true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
 
1
  {
2
+ "architectures": [
3
+ "InternVideo2_Classification_test"
4
+ ],
5
  "auto_map": {
6
+ "AutoModel": "modeling_videochat2_classification.InternVideo2_Classification_test"
7
  },
8
+ "bridge": {
9
+ "extra_num_query_token": 64,
10
+ "name": "qformer",
11
+ "num_query_token": 32,
12
+ "qformer_attention_probs_dropout_prob": 0.1,
13
+ "qformer_drop_path_rate": 0.2,
14
+ "qformer_hidden_dropout_prob": 0.1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  },
16
+ "freeze_bridge": false,
17
+ "freeze_llm": false,
18
+ "freeze_vision_encoder": false,
19
+ "llm": {
20
+ "lora_alpha": 32,
21
+ "lora_dropout": 0.1,
22
+ "lora_r": 16,
23
+ "name": "mistral_7b",
24
+ "pretrained_llm_path": "mistralai/Mistral-7B-Instruct-v0.3",
25
+ "use_lora": true
26
+ },
27
+ "loss": {
28
+ "use_vision_regression_loss": false
29
+ },
30
+ "model_type": "InternVideo2_VideoChat2_test",
31
+ "pretrained_paths": {},
32
  "torch_dtype": "float32",
33
  "transformers_version": "4.46.1",
34
+ "use_flash_attention": true,
35
+ "vision_encoder": {
36
+ "checkpoint_num": 48,
37
+ "d_model": 1408,
38
+ "encoder_embed_dim": 1408,
39
+ "img_size": 224,
40
+ "name": "internvideo2-1B",
41
+ "num_frames": 8,
42
+ "origin_num_frames": 4,
43
+ "patch_size": 14,
44
+ "pretrained": null,
45
+ "sep_image_video_pos_embed": true,
46
+ "tubelet_size": 1,
47
+ "use_checkpoint": true,
48
+ "vit_add_ln": true,
49
+ "x_vis_only": true,
50
+ "x_vis_return_idx": -2
51
+ }
52
  }
modeling_videochat2_classification.py CHANGED
@@ -388,14 +388,15 @@ class InternVideo2_Classification(PreTrainedModel):
388
  class InternVideo2_Classification_test(PreTrainedModel):
389
  config_class = VideoChat2Config
390
  def __init__(self, config):
391
- self.model_config = config.model_config
392
- # config.model_config = None
393
  super().__init__(config)
394
  self.w = torch.randn(10,10, requires_grad=True)
395
 
396
 
397
  def forward(self, x):
398
  return x
 
 
 
399
 
400
  if __name__ == "__main__":
401
 
 
388
  class InternVideo2_Classification_test(PreTrainedModel):
389
  config_class = VideoChat2Config
390
  def __init__(self, config):
 
 
391
  super().__init__(config)
392
  self.w = torch.randn(10,10, requires_grad=True)
393
 
394
 
395
  def forward(self, x):
396
  return x
397
+
398
+ def test_lol(self, x):
399
+ return x
400
 
401
  if __name__ == "__main__":
402