Alikestocode commited on
Commit
7e31310
·
1 Parent(s): 4001f22

Fix oneshot() API: use correct parameter names

Browse files

- Change 'model' to 'model_id'
- Change 'modifiers' to 'recipe_modifiers'
- Change 'calibration_data' to 'recipe_dataset'
- Change 'token' to 'hf_token'
- Fixes HfArgumentParser unrecognized keys error

Files changed (1) hide show
  1. quantize_to_awq_colab.ipynb +12 -5
quantize_to_awq_colab.ipynb CHANGED
@@ -346,14 +346,21 @@
346
  " print(f\" ✅ AWQModifier created successfully\")\n",
347
  " \n",
348
  " # Call oneshot with the modifier\n",
 
 
349
  " print(f\" → Starting quantization process...\")\n",
 
 
 
 
 
 
350
  " oneshot(\n",
351
- " model=repo_id,\n",
352
  " output_dir=temp_output_dir,\n",
353
- " modifiers=modifiers,\n",
354
- " token=os.environ.get(\"HF_TOKEN\"),\n",
355
- " # Calibration data: list of strings\n",
356
- " calibration_data=calibration_texts[:min(calibration_dataset_size, 128)]\n",
357
  " )\n",
358
  " \n",
359
  " print(f\"✅ Model quantized to AWQ successfully\")\n",
 
346
  " print(f\" ✅ AWQModifier created successfully\")\n",
347
  " \n",
348
  " # Call oneshot with the modifier\n",
349
+ " # Note: oneshot() uses HfArgumentParser and expects specific parameter names\n",
350
+ " # Use 'model_id' instead of 'model', and pass modifiers/calibration via recipe or separate args\n",
351
  " print(f\" → Starting quantization process...\")\n",
352
+ " \n",
353
+ " # Prepare calibration dataset (limit to reasonable size)\n",
354
+ " calibration_dataset = calibration_texts[:min(calibration_dataset_size, 128)]\n",
355
+ " \n",
356
+ " # oneshot() API: model_id, output_dir, and recipe parameters\n",
357
+ " # Pass modifiers and dataset via the recipe structure\n",
358
  " oneshot(\n",
359
+ " model_id=repo_id,\n",
360
  " output_dir=temp_output_dir,\n",
361
+ " recipe_modifiers=modifiers,\n",
362
+ " recipe_dataset=calibration_dataset,\n",
363
+ " hf_token=os.environ.get(\"HF_TOKEN\")\n",
 
364
  " )\n",
365
  " \n",
366
  " print(f\"✅ Model quantized to AWQ successfully\")\n",