kd13 commited on
Commit
411f4cb
·
verified ·
1 Parent(s): 73d1ecf

Upload configuration_mobilenet.py

Browse files
Files changed (1) hide show
  1. configuration_mobilenet.py +24 -0
configuration_mobilenet.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PretrainedConfig
2
+
3
+ class MobileNetV1Config(PretrainedConfig):
4
+ model_type = "mobilenet_v1_modern"
5
+
6
+ def __init__(
7
+ self,
8
+ num_classes: int = 200,
9
+ block_dropout: float = 0.0,
10
+ final_dropout: float = 0.50,
11
+ **kwargs
12
+ ):
13
+ self.num_classes = num_classes
14
+ self.block_dropout = block_dropout
15
+ self.final_dropout = final_dropout
16
+
17
+ # This mapping allows AutoModel to find the code when pushed to the Hub
18
+ if "auto_map" not in kwargs:
19
+ kwargs["auto_map"] = {
20
+ "AutoConfig": "configuration_mobilenet.MobileNetV1Config",
21
+ "AutoModelForImageClassification": "modeling_mobilenet.MobileNetV1ForImageClassification"
22
+ }
23
+
24
+ super().__init__(**kwargs)