Update docs for T5 quantization script.

This commit is contained in:
Ryan Dick 2024-08-23 18:07:14 +00:00 committed by Brandon
parent 97562504b7
commit a21f6c4964

View File

@ -20,11 +20,12 @@ def load_state_dict_into_t5(model: T5EncoderModel, state_dict: dict):
def main(): def main():
# Load the FLUX transformer model onto the meta device. """A script for quantizing a T5 text encoder model using the bitsandbytes LLM.int8() quantization method.
model_path = Path(
# "/data/invokeai/models/.download_cache/black-forest-labs_flux.1-schnell/FLUX.1-schnell/text_encoder_2" This script is primarily intended for reference. The script params (e.g. the model_path, modules_to_not_convert,
"/data/misc/text_encoder_2" etc.) are hardcoded and would need to be modified for other use cases.
) """
model_path = Path("/data/misc/text_encoder_2")
with log_time("Intialize T5 on meta device"): with log_time("Intialize T5 on meta device"):
model_config = AutoConfig.from_pretrained(model_path) model_config = AutoConfig.from_pretrained(model_path)