LiqFitModel
class liqfit.modeling.Model
(config: PretrainedConfig,
backbone: LiqFitBackbone | nn.Module | PreTrainedModel,
head: Optional[LiqFitHead] = None,
loss_func: Optional[nn.Module] = None,
normalize_backbone_embeddings: bool = False,
labels_name: str = "labels",
push_backbone_only: bool = False)
Parameters:
config (PretrainedConfig): Backbone configuration.
backbone (nn.Module): Pretrained model (backbone).
head (LiqFitHead): Downstream head.
loss_func (Optional[nn.Module]): Loss function that will be called after each forward pass (if labels are passed). (Defaults to
None).normalize_backbone_embeddings (bool): Whether to normalize the output embeddings from the backbone or not using the
torch.nn.functional.normalize. (Defaults to False).labels_name (str): Labels parameter name that was passed to the
forwardmethodpush_backbone_only (bool, optional): Whether to push the wrapped model or only push the
backbonemodel to Hugging Face.
Using `LiqFitModel` class with `transformers` library.
Using `LiqFitModel` with one of the available heads.
Last updated