@@ -307,14 +307,7 @@ def parse_args(parser: "ArgumentParser"):
307
307
def run (self ):
308
308
from ...exporters .openvino .__main__ import infer_task , main_export , maybe_convert_tokenizers
309
309
from ...exporters .openvino .utils import save_preprocessors
310
- from ...intel .openvino .configuration import (
311
- _DEFAULT_4BIT_CONFIG ,
312
- OVCompressWeightsOptions ,
313
- OVConfig ,
314
- OVGeneralQuantizationConfig ,
315
- OVQuantizeOptions ,
316
- get_default_int4_config ,
317
- )
310
+ from ...intel .openvino .configuration import _DEFAULT_4BIT_CONFIG , OVConfig , get_default_int4_config
318
311
319
312
if self .args .library is None :
320
313
# TODO: add revision, subfolder and token to args
@@ -363,23 +356,17 @@ def run(self):
363
356
if self .args .quant_mode == "nf4_f8e4m3" :
364
357
wc_config = prepare_for_wc_config (self .args , _DEFAULT_4BIT_CONFIG )
365
358
wc_config ["weight_format" ] = "nf4"
366
- cw_options = OVCompressWeightsOptions .init_with_format (** wc_config )
367
359
368
360
q_config = prepare_for_q_config (self .args )
369
361
q_config ["activation_format" ] = "f8e4m3"
370
- q_options = OVQuantizeOptions .init_with_format (** q_config )
371
362
372
- quantization_config = OVGeneralQuantizationConfig .init_with_format (
373
- bits = 8 ,
374
- sym = self .args .sym ,
375
- ignored_scope = None ,
363
+ quantization_config = dict (
364
+ weight_quantization_config = wc_config ,
365
+ quantization_config = q_config ,
376
366
num_samples = self .args .num_samples ,
377
367
dataset = self .args .dataset ,
378
368
trust_remote_code = self .args .trust_remote_code ,
379
- weight_format = self .args .weight_format ,
380
369
)
381
- quantization_config .compress_weights_options = cw_options
382
- quantization_config .quantize_options = q_options
383
370
else :
384
371
quantization_config = prepare_for_q_config (self .args )
385
372
ov_config = OVConfig (quantization_config = quantization_config )
0 commit comments