load_t5_text_encoder

Load a T5 encoder from a transformers directory

Description

Streams the (possibly sharded) safetensors weights into t5_encoder, stripping the encoder. key prefix and aliasing embed_tokens to the shared embedding.

Usage

load_t5_text_encoder(model_path, device = "cpu", dtype = "float32",
                     verbose = TRUE, ...)

Arguments

  • model_path: Directory with config.json and model*.safetensors (FLUX.1-schnell’s text_encoder_2).
  • device: Character. Target device.
  • dtype: Character. “float32” (CPU default; T5 overflows in float16) or “bfloat16”.
  • verbose: Logical.
  • ...: Overrides for t5_encoder arguments.

Value

The loaded t5_encoder in eval mode.