dot-load_weights: Load Pretrained Weights into a Transformers Model

.load_weightsR Documentation

Load Pretrained Weights into a Transformers Model

Description

Loads specified pretrained weights into the given BERT model.

Usage

.load_weights(
  model,
  model_name = "microsoft/layoutlm-base-uncased",
  redownload = FALSE,
  timeout = 720
)

Arguments

model

A transformers-type nn_module model.

model_name

Character; which public Transformers model weights to use. Must be compatible with model architecture!. Can be an local file name.

redownload

Logical: Shall we force redownload the model weights ?

Value

The number of model parameters updated. (This is to enable error checks; the function is called for side effects.)


cregouby/docformer documentation built on May 27, 2023, 11:19 p.m.