你好,请帮我按照transformers的clip类的参数,修改下面这个clip conv loss 以下是transformers clip类的参数…
- User
你好,请帮我按照transformers的clip类的参数,修改下面这个clip conv loss 以下是transformers clip类的参数 CLIPVisionModelWithProjection class transformers.CLIPVisionModelWithProjection < source
( config: CLIPVisionConfig )
Parameters
config (CLIPConfig) — Model configuration class with all the parameters of the model. Initializing with a config file does not load the weights associated with the model, only the configuration. Check out the from_pretrained() method to load the model weights. CLIP Vision Model with a projection layer on top (a linear layer on top of the pooled output).
This model inherits from PreTrainedModel. Check the superclass documentation for the generic methods the library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads etc.)
This model is also a PyTorch torch.nn.Module subclass. Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.
forward < source
( pixel_values: Optional = Noneoutput_attentions: Optional = Noneoutput_hidden_states: Optional = Noneinterpolate_pos_encoding: bool = Falsereturn_dict: Optional = None ) → transformers.models.clip.modeling_clip.CLIPVisionModelOutput or tuple(torch.FloatTensor)
Parameters
pixel_values (torch.FloatTensor of shape (batch_size, num_channels, height, width)) — Pixel values. Padding will be ignored by default should you provide it. Pixel values can be obtained using AutoImageProcessor. See CLIPImageProcessor.call() for details. output_attentions (bool, optional) — Whether or not to return the attentions tensors of all attention layers. See attentions under returned tensors for more detail. output_hidden_states (bool, optional) — Whether or not to return the hidden states of all layers. See hidden_states under returned tensors for more detail. interpolate_pos_encoding (bool, optional, defaults False) — Whether to interpolate the pre-trained position encodings. return_dict (bool, optional) — Whether or not to return a ModelOutput instead of a plain tuple. Returns
transformers.models.clip.modeling_clip.CLIPVisionModelOutput or tuple(torch.FloatTensor)
A transformers.models.clip.modeling_clip.CLIPVisionModelOutput or a tuple of torch.FloatTensor (if return_dict=False is passed or when config.return_dict=False) comprising various elements depending on the configuration (<class 'transformers.models.clip.configuration_clip.CLIPVisionConfig'>) and inputs.
image_embeds (torch.FloatTensor of shape (batch_size, output_dim) optional returned when model is initialized with with_projection=True) — The image embeddings obtained by applying the projection layer to the pooler_output.
last_hidden_state (torch.FloatTensor of shape (batch_size, sequence_length, hidden_size)) — Sequence of hidden-states at the output of the last layer of the model.
- Assistant