louislu9911 commited on
Commit
924cafd
1 Parent(s): be61695

Training in progress, epoch 0

Browse files
Files changed (4) hide show
  1. config.json +4 -0
  2. configuration_moe.py +38 -0
  3. model.safetensors +1 -1
  4. training_args.bin +1 -1
config.json CHANGED
@@ -2,6 +2,10 @@
2
  "architectures": [
3
  "MoEModelForImageClassification"
4
  ],
 
 
 
 
5
  "base_model": "louislu9911/BaseModel-leaf-disease-convnextv2-base-1k-224-0_1_2_3_4",
6
  "expert_class_mapping": {
7
  "0": [
 
2
  "architectures": [
3
  "MoEModelForImageClassification"
4
  ],
5
+ "auto_map": {
6
+ "AutoConfig": "configuration_moe.MoEConfig",
7
+ "AutoModelForImageClassification": "modeling_moe.MoEModelForImageClassification"
8
+ },
9
  "base_model": "louislu9911/BaseModel-leaf-disease-convnextv2-base-1k-224-0_1_2_3_4",
10
  "expert_class_mapping": {
11
  "0": [
configuration_moe.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import PretrainedConfig
2
+ from typing import Dict, List
3
+
4
+
5
+ MOE_MODEL_TYPE = "moe"
6
+ DEFAULT_HUGGINGFACE_ACCOUNT = "louislu9911"
7
+ model_checkpoint = "convnextv2-base-1k-224"
8
+
9
+ EXPERTS = [
10
+ f"{DEFAULT_HUGGINGFACE_ACCOUNT}/Expert1-leaf-disease-{model_checkpoint}-0_4",
11
+ f"{DEFAULT_HUGGINGFACE_ACCOUNT}/Expert2-leaf-disease-{model_checkpoint}-1_2_3",
12
+ ]
13
+ SWITCH_GATE = (
14
+ f"{DEFAULT_HUGGINGFACE_ACCOUNT}/switch_gate-leaf-disease-{model_checkpoint}"
15
+ )
16
+ BASE_MODEL = (
17
+ f"{DEFAULT_HUGGINGFACE_ACCOUNT}/BaseModel-leaf-disease-{model_checkpoint}-0_1_2_3_4"
18
+ )
19
+
20
+
21
+ class MoEConfig(PretrainedConfig):
22
+ model_type = MOE_MODEL_TYPE
23
+
24
+ def __init__(
25
+ self,
26
+ experts: List[str] = EXPERTS,
27
+ switch_gate: str = SWITCH_GATE,
28
+ base_model: str = BASE_MODEL,
29
+ num_classes: int = 5,
30
+ expert_class_mapping: Dict[int, List[int]] = None,
31
+ **kwargs,
32
+ ):
33
+ self.experts = experts
34
+ self.switch_gate = switch_gate
35
+ self.base_model = base_model
36
+ self.num_classes = num_classes
37
+ self.expert_class_mapping = expert_class_mapping
38
+ super().__init__(**kwargs)
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:202420bda35fa4af9cd6e312b9bc210c37ae89dc516642be29de4c884300fe5e
3
  size 2372917736
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:996c902806c49871bb4063f579dd93b84bc57405078adf888f6b448ca71e02cc
3
  size 2372917736
training_args.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cc84669429ebb25a4ae898305118aebaf5c98611ab97e671a5f139253c6b6e61
3
  size 4984
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f627c5b913dbe30b5014b3d88870ee151056a3d09224cf196a93ea68d19f5210
3
  size 4984