mwauranjorogekelvin commited on
Commit
8d1e199
·
verified ·
1 Parent(s): 17fbd46

Update download_model.py

Browse files
Files changed (1) hide show
  1. download_model.py +1 -5
download_model.py CHANGED
@@ -29,19 +29,15 @@ for cfg in configs:
29
  if not model_path:
30
  raise RuntimeError("Could not find model.onnx in any repo type")
31
 
32
- # Save original first
33
  print("Saving original model...")
34
  shutil.copy(model_path, "./model/model_original.onnx")
35
 
36
- # Quantize to INT8
37
  print("Quantizing to INT8...")
38
  quantize_dynamic(
39
  model_input="./model/model_original.onnx",
40
  model_output="./model/model.onnx",
41
- weight_type=QuantType.QUInt8,
42
- optimize_model=True
43
  )
44
 
45
- # Remove original to save space
46
  os.remove("./model/model_original.onnx")
47
  print("✅ Quantized ONNX model saved to ./model/model.onnx")
 
29
  if not model_path:
30
  raise RuntimeError("Could not find model.onnx in any repo type")
31
 
 
32
  print("Saving original model...")
33
  shutil.copy(model_path, "./model/model_original.onnx")
34
 
 
35
  print("Quantizing to INT8...")
36
  quantize_dynamic(
37
  model_input="./model/model_original.onnx",
38
  model_output="./model/model.onnx",
39
+ weight_type=QuantType.QUInt8
 
40
  )
41
 
 
42
  os.remove("./model/model_original.onnx")
43
  print("✅ Quantized ONNX model saved to ./model/model.onnx")