File size: 697 Bytes
d9a550a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from transformers import PretrainedConfig, VisionEncoderDecoderConfig
from typing import List
class Magiv2Config(PretrainedConfig):
model_type = "magiv2"
def __init__(
self,
crop_embedding_model_config: dict = None,
crop_embedding_image_preprocessing_config: dict = None,
**kwargs,
):
self.kwargs = kwargs
self.crop_embedding_model_config = None
if crop_embedding_model_config is not None:
self.crop_embedding_model_config = PretrainedConfig.from_dict(crop_embedding_model_config)
self.crop_embedding_image_preprocessing_config = crop_embedding_image_preprocessing_config
super().__init__(**kwargs) |