Alikestocode commited on
Commit
f0033ab
·
1 Parent(s): 2326498

Fix AWQModifier import path: use modifiers.awq instead of modifiers.quantization

Browse files

- Correct import: from llmcompressor.modifiers.awq import AWQModifier
- Wrong import: from llmcompressor.modifiers.quantization import AWQModifier
- Updated all files with correct import path
- Added upgrade suggestion in error message

LLM_COMPRESSOR_FEATURES.md CHANGED
@@ -10,7 +10,7 @@ LLM Compressor supports multiple quantization methods beyond AWQ:
10
 
11
  #### AWQModifier (Activation-aware Weight Quantization)
12
  ```python
13
- from llmcompressor.modifiers.quantization import AWQModifier
14
 
15
  AWQModifier(
16
  w_bit=4, # Weight bits (4 or 8)
@@ -60,7 +60,7 @@ You can combine multiple modifiers for maximum compression:
60
 
61
  ```python
62
  from llmcompressor import oneshot
63
- from llmcompressor.modifiers.quantization import AWQModifier
64
  from llmcompressor.modifiers.pruning import MagnitudePruningModifier
65
 
66
  oneshot(
 
10
 
11
  #### AWQModifier (Activation-aware Weight Quantization)
12
  ```python
13
+ from llmcompressor.modifiers.awq import AWQModifier
14
 
15
  AWQModifier(
16
  w_bit=4, # Weight bits (4 or 8)
 
60
 
61
  ```python
62
  from llmcompressor import oneshot
63
+ from llmcompressor.modifiers.awq import AWQModifier
64
  from llmcompressor.modifiers.pruning import MagnitudePruningModifier
65
 
66
  oneshot(
QUANTIZE_AWQ.md CHANGED
@@ -73,7 +73,7 @@ If you prefer using llm-compressor (vLLM's quantization tool):
73
 
74
  ```python
75
  from llmcompressor import oneshot
76
- from llmcompressor.modifiers.quantization import AWQModifier
77
 
78
  # Quantize model
79
  oneshot(
 
73
 
74
  ```python
75
  from llmcompressor import oneshot
76
+ from llmcompressor.modifiers.awq import AWQModifier
77
 
78
  # Quantize model
79
  oneshot(
app.py CHANGED
@@ -43,7 +43,8 @@ try:
43
  # Try both package names (llm-compressor and llmcompressor)
44
  try:
45
  from llmcompressor import oneshot
46
- from llmcompressor.modifiers.quantization import AWQModifier
 
47
  except ImportError:
48
  # Try alternative package name
49
  import sys
@@ -55,7 +56,7 @@ try:
55
  if spec is None:
56
  raise ImportError("llm-compressor not found")
57
  from llm_compressor import oneshot
58
- from llm_compressor.modifiers.quantization import AWQModifier
59
  except ImportError:
60
  raise ImportError("Neither llmcompressor nor llm-compressor found")
61
  LLM_COMPRESSOR_AVAILABLE = True
 
43
  # Try both package names (llm-compressor and llmcompressor)
44
  try:
45
  from llmcompressor import oneshot
46
+ # Correct import path: AWQModifier is in modifiers.awq, not modifiers.quantization
47
+ from llmcompressor.modifiers.awq import AWQModifier
48
  except ImportError:
49
  # Try alternative package name
50
  import sys
 
56
  if spec is None:
57
  raise ImportError("llm-compressor not found")
58
  from llm_compressor import oneshot
59
+ from llm_compressor.modifiers.awq import AWQModifier
60
  except ImportError:
61
  raise ImportError("Neither llmcompressor nor llm-compressor found")
62
  LLM_COMPRESSOR_AVAILABLE = True
quantize_to_awq_colab.ipynb CHANGED
@@ -148,7 +148,8 @@
148
  "# Import with error handling in case installation failed\n",
149
  "try:\n",
150
  " from llmcompressor import oneshot\n",
151
- " from llmcompressor.modifiers.quantization import AWQModifier\n",
 
152
  " LLM_COMPRESSOR_AVAILABLE = True\n",
153
  " print(\"✅ LLM Compressor imported successfully\")\n",
154
  "except ImportError as e:\n",
@@ -157,6 +158,8 @@
157
  " print(\" %pip install llmcompressor\")\n",
158
  " print(\" OR\")\n",
159
  " print(\" %pip install git+https://github.com/vllm-project/llm-compressor.git\")\n",
 
 
160
  " LLM_COMPRESSOR_AVAILABLE = False\n",
161
  " raise\n",
162
  "\n",
 
148
  "# Import with error handling in case installation failed\n",
149
  "try:\n",
150
  " from llmcompressor import oneshot\n",
151
+ " # Correct import path: AWQModifier is in modifiers.awq, not modifiers.quantization\n",
152
+ " from llmcompressor.modifiers.awq import AWQModifier\n",
153
  " LLM_COMPRESSOR_AVAILABLE = True\n",
154
  " print(\"✅ LLM Compressor imported successfully\")\n",
155
  "except ImportError as e:\n",
 
158
  " print(\" %pip install llmcompressor\")\n",
159
  " print(\" OR\")\n",
160
  " print(\" %pip install git+https://github.com/vllm-project/llm-compressor.git\")\n",
161
+ " print(\"\\nNote: If import still fails, try:\")\n",
162
+ " print(\" %pip install --upgrade llmcompressor\")\n",
163
  " LLM_COMPRESSOR_AVAILABLE = False\n",
164
  " raise\n",
165
  "\n",