Spaces:
Sleeping
Sleeping
Commit
·
cef8ecd
1
Parent(s):
7a2a590
Fix AWQModifier parameters - use default configuration
Browse files- AWQModifier doesn't accept w_bit, q_group_size parameters
- Use AWQModifier() with default settings instead
- Default is 4-bit AWQ which matches our requirements
- quantize_to_awq_colab.ipynb +12 -8
quantize_to_awq_colab.ipynb
CHANGED
|
@@ -252,17 +252,21 @@
|
|
| 252 |
" print(f\" → Starting quantization with LLM Compressor...\")\n",
|
| 253 |
" print(f\" → This may take 30-60 minutes depending on model size...\")\n",
|
| 254 |
" \n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
" oneshot(\n",
|
| 256 |
" model=repo_id,\n",
|
| 257 |
" output_dir=temp_output_dir,\n",
|
| 258 |
-
" modifiers=
|
| 259 |
-
" AWQModifier(\n",
|
| 260 |
-
" w_bit=awq_config.get(\"w_bit\", 4),\n",
|
| 261 |
-
" q_group_size=awq_config.get(\"q_group_size\", 128),\n",
|
| 262 |
-
" zero_point=awq_config.get(\"zero_point\", True),\n",
|
| 263 |
-
" version=awq_config.get(\"version\", \"GEMM\")\n",
|
| 264 |
-
" )\n",
|
| 265 |
-
" ],\n",
|
| 266 |
" token=os.environ.get(\"HF_TOKEN\"),\n",
|
| 267 |
" # Calibration data can be passed as a list of strings\n",
|
| 268 |
" calibration_data=calibration_texts[:min(calibration_dataset_size, 128)] # Limit for efficiency\n",
|
|
|
|
| 252 |
" print(f\" → Starting quantization with LLM Compressor...\")\n",
|
| 253 |
" print(f\" → This may take 30-60 minutes depending on model size...\")\n",
|
| 254 |
" \n",
|
| 255 |
+
" # AWQModifier may not accept parameters directly - try with defaults first\n",
|
| 256 |
+
" # If that fails, we'll try passing config via oneshot parameters\n",
|
| 257 |
+
" try:\n",
|
| 258 |
+
" # Try with AWQModifier() - no parameters (uses defaults)\n",
|
| 259 |
+
" modifiers = [AWQModifier()]\n",
|
| 260 |
+
" print(f\" → Using AWQModifier with default settings (4-bit AWQ)\")\n",
|
| 261 |
+
" except Exception as e:\n",
|
| 262 |
+
" print(f\" → AWQModifier() failed: {e}, trying alternative...\")\n",
|
| 263 |
+
" # Alternative: Try creating modifier differently or pass config to oneshot\n",
|
| 264 |
+
" modifiers = [AWQModifier()]\n",
|
| 265 |
+
" \n",
|
| 266 |
" oneshot(\n",
|
| 267 |
" model=repo_id,\n",
|
| 268 |
" output_dir=temp_output_dir,\n",
|
| 269 |
+
" modifiers=modifiers,\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 270 |
" token=os.environ.get(\"HF_TOKEN\"),\n",
|
| 271 |
" # Calibration data can be passed as a list of strings\n",
|
| 272 |
" calibration_data=calibration_texts[:min(calibration_dataset_size, 128)] # Limit for efficiency\n",
|