Skip to content

Conversation

@dsocek
Copy link
Contributor

@dsocek dsocek commented Apr 16, 2025

Type of Change

  • Simple bug fix (in documentation)
  • API not changed

Description

Example in README is crashing due to invalid argument passing

Before fix:
Output Error:

Traceback (most recent call last):
  File "/root/flux_peft_fp8/neural-compressor/examples/pytorch/nlp/huggingface_models/text-to-image/quantization/run_diffusion.py", line 337, in <module>
    main()
  File "/root/flux_peft_fp8/neural-compressor/examples/pytorch/nlp/huggingface_models/text-to-image/quantization/run_diffusion.py", line 290, in main
    quantization_config = PostTrainingQuantConfig(
  File "/usr/local/lib/python3.10/dist-packages/neural_compressor/config.py", line 1322, in __init__
    self.approach = approach
  File "/usr/local/lib/python3.10/dist-packages/neural_compressor/config.py", line 1337, in approach
    if _check_value("approach", approach, str, ["static", "dynamic", "auto", "weight_only"]):
  File "/usr/local/lib/python3.10/dist-packages/neural_compressor/config.py", line 102, in _check_value
    assert False, "{} is not in supported {}: {}. Skip setting it.".format(src, name, str(supported_value))
AssertionError: PostTrainingStatic is not in supported approach: ['static', 'dynamic', 'auto', 'weight_only']. Skip setting it.

After fix:
Output OK

Signed-off-by: Daniel Socek <daniel.socek@intel.com>
@XuehaoSun XuehaoSun requested review from Copilot and xin3he April 17, 2025 05:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@XuehaoSun XuehaoSun merged commit 2032e77 into intel:master Apr 18, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants