, torch_dtype=torch.float16
... )
>>> model = model.to("cuda")
>>> model.enable_xformers_memory_efficient_attention(attention_op=MemoryEfficientAttentionFlashAttentionOp)

from_pretrained

<
source
>
(
pretrained_model_name_or_path: typing.Union[str, os.PathLike, NoneType]
**kwargs

)


Parameters 

pretrained_model_name_or_path (str or os.PathLike, optional) —
Can be either:

A string, the model id of a pretrained model hosted inside a model r