codingutf8 c facebook inc and its affiliates c huggingface inc team licensed under the apache license version 2 0 the license you may not use this file except in compliance with the license you may obtain a copy of the license at http www apache orglicenseslicense2 0 unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license mmbt configuration from utils import logging logger logging getloggername class mmbtconfigobject def initself config numlabelsnone modalhiddensize2048 self dict config dict self modalhiddensize modalhiddensize if numlabels self numlabels numlabels coding utf 8 c facebook inc and its affiliates c huggingface inc team licensed under the apache license version 2 0 the license you may not use this file except in compliance with the license you may obtain a copy of the license at http www apache org licenses license 2 0 unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license mmbt configuration this is the configuration class to store the configuration of a mmbtmodel it is used to instantiate a mmbt model according to the specified arguments defining the model architecture args config pretrainedconfig config of the underlying transformer models its values are copied over to use a single config num_labels int optional size of final linear layer for classification modal_hidden_size int optional defaults to 2048 embedding dimension of the non text modality encoder
from ....utils import logging


logger = logging.get_logger(__name__)


class MMBTConfig(object):
    

    def __init__(self, config, num_labels=None, modal_hidden_size=2048):
        self.__dict__ = config.__dict__
        self.modal_hidden_size = modal_hidden_size
        if num_labels:
            self.num_labels = num_labels