remove custom config (handled by vLLM plugin)
Browse files- configuration_brain_ocr.py +0 -35
configuration_brain_ocr.py
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
from transformers import PretrainedConfig
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
class BrainOCRVisionConfig(PretrainedConfig):
|
| 5 |
-
model_type = "brain_ocr_vision"
|
| 6 |
-
|
| 7 |
-
def __init__(self, image_size=560, patch_size=14, hidden_size=1280,
|
| 8 |
-
intermediate_size=5120, num_hidden_layers=32,
|
| 9 |
-
num_attention_heads=16, channels=3, layer_norm_eps=1e-6,
|
| 10 |
-
attention_dropout=0.0, **kwargs):
|
| 11 |
-
super().__init__(**kwargs)
|
| 12 |
-
self.image_size = image_size
|
| 13 |
-
self.patch_size = patch_size
|
| 14 |
-
self.hidden_size = hidden_size
|
| 15 |
-
self.intermediate_size = intermediate_size
|
| 16 |
-
self.num_hidden_layers = num_hidden_layers
|
| 17 |
-
self.num_attention_heads = num_attention_heads
|
| 18 |
-
self.channels = channels
|
| 19 |
-
self.layer_norm_eps = layer_norm_eps
|
| 20 |
-
self.attention_dropout = attention_dropout
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
class BrainOCRConfig(PretrainedConfig):
|
| 24 |
-
model_type = "brain_ocr"
|
| 25 |
-
sub_configs = {"vision_config": BrainOCRVisionConfig}
|
| 26 |
-
|
| 27 |
-
def __init__(self, **kwargs):
|
| 28 |
-
vision_config = kwargs.pop("vision_config", None)
|
| 29 |
-
if isinstance(vision_config, dict):
|
| 30 |
-
self.vision_config = BrainOCRVisionConfig(**vision_config)
|
| 31 |
-
elif isinstance(vision_config, BrainOCRVisionConfig):
|
| 32 |
-
self.vision_config = vision_config
|
| 33 |
-
else:
|
| 34 |
-
self.vision_config = BrainOCRVisionConfig()
|
| 35 |
-
super().__init__(**kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|