Spaces:
Running
on
Zero
Running
on
Zero
Update qwenimage/optimization.py
Browse files
qwenimage/optimization.py
CHANGED
|
@@ -20,7 +20,7 @@ import torch
|
|
| 20 |
from torch.utils._pytree import tree_map
|
| 21 |
from torchao.utils import get_model_size_in_bytes
|
| 22 |
|
| 23 |
-
from qwenimage.datamodels import QuantOptions
|
| 24 |
from qwenimage.debug import ftimed, print_first_param
|
| 25 |
|
| 26 |
|
|
@@ -135,7 +135,7 @@ def optimize_pipeline_(
|
|
| 135 |
aoti_apply(compiled_transformer, pipeline.transformer)
|
| 136 |
|
| 137 |
|
| 138 |
-
def simple_quantize_model(model, quant_option: QuantOptions):
|
| 139 |
if quant_option == QuantOptions.INT8WO:
|
| 140 |
aoconfig = Int8WeightOnlyConfig()
|
| 141 |
elif quant_option == QuantOptions.INT4WO:
|
|
|
|
| 20 |
from torch.utils._pytree import tree_map
|
| 21 |
from torchao.utils import get_model_size_in_bytes
|
| 22 |
|
| 23 |
+
# from qwenimage.datamodels import QuantOptions
|
| 24 |
from qwenimage.debug import ftimed, print_first_param
|
| 25 |
|
| 26 |
|
|
|
|
| 135 |
aoti_apply(compiled_transformer, pipeline.transformer)
|
| 136 |
|
| 137 |
|
| 138 |
+
def simple_quantize_model(model, quant_option: 'QuantOptions'):
|
| 139 |
if quant_option == QuantOptions.INT8WO:
|
| 140 |
aoconfig = Int8WeightOnlyConfig()
|
| 141 |
elif quant_option == QuantOptions.INT4WO:
|