Upload config
Browse files- MyConfig.py +17 -0
- config.json +9 -0
MyConfig.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from transformers import PretrainedConfig
|
3 |
+
from typing import List
|
4 |
+
|
5 |
+
class MnistConfig(PretrainedConfig):
|
6 |
+
# since we have an image classification task
|
7 |
+
# we need to put a model type that is close to our task
|
8 |
+
# don't worry this will not affect our model
|
9 |
+
model_type = "MobileNetV1"
|
10 |
+
def __init__(
|
11 |
+
self,
|
12 |
+
conv1=10,
|
13 |
+
conv2=20,
|
14 |
+
**kwargs):
|
15 |
+
self.conv1 = conv1
|
16 |
+
self.conv2 = conv2
|
17 |
+
super().__init__(**kwargs)
|
config.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"auto_map": {
|
3 |
+
"AutoConfig": "MyConfig.MnistConfig"
|
4 |
+
},
|
5 |
+
"conv1": 10,
|
6 |
+
"conv2": 20,
|
7 |
+
"model_type": "MobileNetV1",
|
8 |
+
"transformers_version": "4.35.2"
|
9 |
+
}
|