amisima commited on
Commit
d3c2db6
·
verified ·
1 Parent(s): 60a5ac8

Upload h3_quantization.py

Browse files
Files changed (1) hide show
  1. h3_quantization.py +4 -2
h3_quantization.py CHANGED
@@ -12,7 +12,7 @@ def load_int8_transformer(repo):
12
  from torchao.quantization import Int8WeightOnlyConfig
13
  except ImportError as error:
14
  raise RuntimeError(
15
- "INT8 needs the optional requirements-int8.txt dependencies. "
16
  "Use H3_QUANTIZATION=bf16 for the existing supported path."
17
  ) from error
18
  model = MiniMaxH3Transformer3DModel.from_pretrained(
@@ -24,7 +24,9 @@ def load_int8_transformer(repo):
24
  "token_refiner", "norm_out", "proj_out", "audio_proj_out",
25
  ],
26
  ),
27
- low_cpu_mem_usage=False,
 
 
28
  )
29
  model.requires_grad_(False)
30
  return model
 
12
  from torchao.quantization import Int8WeightOnlyConfig
13
  except ImportError as error:
14
  raise RuntimeError(
15
+ "INT8 needs torchao==0.17.0 in the main requirements.txt. "
16
  "Use H3_QUANTIZATION=bf16 for the existing supported path."
17
  ) from error
18
  model = MiniMaxH3Transformer3DModel.from_pretrained(
 
24
  "token_refiner", "norm_out", "proj_out", "audio_proj_out",
25
  ],
26
  ),
27
+ # The pinned Diffusers ModelMixin rejects False with a quantizer.
28
+ # Accelerate is already pinned in requirements.txt for this load path.
29
+ low_cpu_mem_usage=True,
30
  )
31
  model.requires_grad_(False)
32
  return model