mfai.pytorch.models.llms

class mfai.pytorch.models.llms.FreezeMLMMixin[source]

Bases: object

A Mixin for (un)freezing llm and vision stages of a multimodal model.

backend: GPT2 | Llama2 | CrossAttentionGPT2 | Llama3
freeze_llm()[source]

Freeze the LLM layers (not the vision layers).

Return type:

None

freeze_vision()[source]

Freeze the vision encoder layers.

Return type:

None

unfreeze_llm()[source]

Unfreeze the LLM layers.

Return type:

None

unfreeze_vision()[source]

Unfreeze the vision encoder layers.

Return type:

None

vision_encoder: Module