[Blip2] Add int8 support for blip2-flan-t5-xxl (#21574)

add int8 support
This commit is contained in:
Younes Belkada 2023-02-10 23:28:24 +01:00 committed by GitHub
parent b47a16743b
commit 75a208ef66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,6 +285,7 @@ class Blip2PreTrainedModel(PreTrainedModel):
r"language_model.decoder.embed_tokens.weight",
]
_no_split_modules = ["Blip2Attention", "T5Block", "OPTDecoderLayer"]
_keep_in_fp32_modules = ["wo"]
def _init_weights(self, module):
"""Initialize the weights"""