ductai199x
commited on
Commit
·
acadfd0
1
Parent(s):
0f0c271
add configuration file and automap to config.json
Browse files
config.json
CHANGED
@@ -3,6 +3,11 @@
|
|
3 |
"architectures": [
|
4 |
"SamHQModel"
|
5 |
],
|
|
|
|
|
|
|
|
|
|
|
6 |
"initializer_range": 0.02,
|
7 |
"mask_decoder_config": {
|
8 |
"model_type": "",
|
|
|
3 |
"architectures": [
|
4 |
"SamHQModel"
|
5 |
],
|
6 |
+
"auto_map": {
|
7 |
+
"AutoConfig": "configuration_sam_hq.SamHQConfig",
|
8 |
+
"AutoModel": "modeling_sam_hq.SamHQModel",
|
9 |
+
"AutoModelForMaskGeneration": "modeling_sam_hq.SamHQModel",
|
10 |
+
},
|
11 |
"initializer_range": 0.02,
|
12 |
"mask_decoder_config": {
|
13 |
"model_type": "",
|
configuration_sam_hq.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers.models.sam.configuration_sam import SamConfig
|
2 |
+
|
3 |
+
class SamHQConfig(SamConfig):
|
4 |
+
model_type = "sam_hq"
|
modeling_sam_hq_vit_huge.py → modeling_sam_hq.py
RENAMED
@@ -34,7 +34,8 @@ from transformers.utils import (
|
|
34 |
add_start_docstrings_to_model_forward,
|
35 |
logging,
|
36 |
)
|
37 |
-
from transformers.models.sam.configuration_sam import
|
|
|
38 |
|
39 |
|
40 |
logger = logging.get_logger(__name__)
|
@@ -1187,10 +1188,6 @@ class SamVisionEncoder(nn.Module):
|
|
1187 |
)
|
1188 |
|
1189 |
|
1190 |
-
class SamHQConfig(SamConfig):
|
1191 |
-
model_type = "sam_hq"
|
1192 |
-
|
1193 |
-
|
1194 |
class SamHQPreTrainedModel(PreTrainedModel):
|
1195 |
config_class = SamHQConfig
|
1196 |
base_model_prefix = "sam_hq"
|
|
|
34 |
add_start_docstrings_to_model_forward,
|
35 |
logging,
|
36 |
)
|
37 |
+
from transformers.models.sam.configuration_sam import SamMaskDecoderConfig, SamPromptEncoderConfig, SamVisionConfig
|
38 |
+
from .configuration_sam_hq import SamHQConfig
|
39 |
|
40 |
|
41 |
logger = logging.get_logger(__name__)
|
|
|
1188 |
)
|
1189 |
|
1190 |
|
|
|
|
|
|
|
|
|
1191 |
class SamHQPreTrainedModel(PreTrainedModel):
|
1192 |
config_class = SamHQConfig
|
1193 |
base_model_prefix = "sam_hq"
|