shravvvv commited on
Commit
a041fbe
·
1 Parent(s): b99e299

Updated files

Browse files
model_dir/config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "shravvvv/SAG-ViT",
3
+ "architectures": [
4
+ "SAGViTClassifier"
5
+ ],
6
+ "d_model": 64,
7
+ "dim_feedforward": 64,
8
+ "gcn_hidden": 128,
9
+ "gcn_out": 64,
10
+ "hidden_mlp_features": 64,
11
+ "in_channels": 2560,
12
+ "model_type": "sagvit",
13
+ "nhead": 4,
14
+ "num_classes": 10,
15
+ "num_layers": 2,
16
+ "patch_size": [
17
+ 4,
18
+ 4
19
+ ],
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.47.0",
22
+ "use_safetensors": true
23
+ }
model_dir/pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3472578af5e4fd2f9644e94f8502895fc007abea1e6880364c0480b588c474a0
3
+ size 32491922
push_model_to_hfhub.py CHANGED
@@ -1,9 +1,10 @@
1
  from transformers import AutoConfig, AutoModel
2
- from modeling_sagvit import SAGViTClassifier
3
 
4
- # Initialize config and model
5
  config = AutoConfig.from_pretrained("shravvvv/SAG-ViT")
6
- model = AutoModel.from_pretrained("shravvvv/SAG-ViT", config=config)
7
 
8
- # Push model to the Hub
 
9
  model.push_to_hub("shravvvv/SAG-ViT")
 
1
  from transformers import AutoConfig, AutoModel
2
+ from modeling_sagvit import SAGViTClassifier, SAGViTConfig
3
 
4
+ # Load config and model
5
  config = AutoConfig.from_pretrained("shravvvv/SAG-ViT")
6
+ model = SAGViTClassifier(config)
7
 
8
+ # Save model locally before pushing
9
+ model.save_pretrained("./model_dir", safe_serialization=False) # Save in PyTorch format
10
  model.push_to_hub("shravvvv/SAG-ViT")
test_model_loading.py CHANGED
@@ -1,6 +1,8 @@
1
- from transformers import AutoModelForImageClassification, AutoImageProcessor
2
 
3
- model = AutoModelForImageClassification.from_pretrained("shravvvv/SAG-ViT", trust_remote_code=True)
4
- processor = AutoImageProcessor.from_pretrained("shravvvv/SAG-ViT", trust_remote_code=True)
 
5
 
 
6
  print(model)
 
1
+ from transformers import AutoModel, AutoConfig
2
 
3
+ # Load Config and Model
4
+ config = AutoConfig.from_pretrained("shravvvv/SAG-ViT")
5
+ model = AutoModel.from_pretrained("shravvvv/SAG-ViT", config=config)
6
 
7
+ # Check Model
8
  print(model)