t5gemma ¶
T5-Gemma encoder wrapper for daVinci-MagiHuman.
MagiHuman uses transformers.models.t5gemma.T5GemmaEncoderModel on google/t5gemma-9b-9b-ul2 (a gated Google repo). This wrapper follows the same lazy-loading pattern as fastvideo/models/encoders/gemma.py: we keep the HF module under self._t5gemma_model and exclude it from named_parameters so FastVideo's weight loader does not try to load encoder shards from the converted repo directory.
For the base MagiHuman T2V port there are no additional connector layers on top — the pipeline prompt-preprocessing stage handles pad-or-trim to text_len and exposes both the padded embedding and the original length.
Classes¶
fastvideo.models.encoders.t5gemma.T5GemmaEncoderModel ¶
Bases: TextEncoder
Thin wrapper over HuggingFace's T5GemmaEncoderModel.
On first forward, the wrapper lazily instantiates the upstream encoder from t5gemma_model_path (defaulting to google/t5gemma-9b-9b-ul2). Afterwards, forward returns a BaseEncoderOutput with last_hidden_state = [B, L, 3584] matching MagiHuman's context.half() output.