morpheushoc commited on
Commit
2a5abdf
·
verified ·
1 Parent(s): bfec927

Upload InternVideo2_Classification_test

Browse files
config.json CHANGED
@@ -1,7 +1,13 @@
1
  {
 
 
 
 
2
  "auto_map": {
3
- "AutoConfig": "model_config.VideoChat2Config"
 
4
  },
 
5
  "model_config": {
6
  "bridge": {
7
  "extra_num_query_token": 64,
 
1
  {
2
+ "_name_or_path": "OpenGVLab/InternVideo2-Chat-8B",
3
+ "architectures": [
4
+ "InternVideo2_Classification_test"
5
+ ],
6
  "auto_map": {
7
+ "AutoConfig": "OpenGVLab/InternVideo2-Chat-8B--model_config.VideoChat2Config",
8
+ "AutoModel": "modeling_videochat2_classification.InternVideo2_Classification_test"
9
  },
10
+ "model_cls": "InternVideo2_VideoChat2",
11
  "model_config": {
12
  "bridge": {
13
  "extra_num_query_token": 64,
modeling_videochat2_classification.py CHANGED
@@ -384,6 +384,19 @@ class InternVideo2_Classification(PreTrainedModel):
384
  def device(self):
385
  return self.lm.device
386
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  if __name__ == "__main__":
388
 
389
  tokenizer = AutoTokenizer.from_pretrained('OpenGVLab/InternVideo2-Chat-8B',trust_remote_code=True,use_fast=False)
 
384
  def device(self):
385
  return self.lm.device
386
 
387
+
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
 
402
  tokenizer = AutoTokenizer.from_pretrained('OpenGVLab/InternVideo2-Chat-8B',trust_remote_code=True,use_fast=False)