Upload ms-swift/examples/export/quantize/bert/bnb.sh with huggingface_hub
Browse files
ms-swift/examples/export/quantize/bert/bnb.sh
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# merge-lora
|
| 2 |
+
CUDA_VISIBLE_DEVICES=0 swift export \
|
| 3 |
+
--adapters swift/test_bert \
|
| 4 |
+
--output_dir output/swift_test_bert_merged \
|
| 5 |
+
--merge_lora true
|
| 6 |
+
|
| 7 |
+
# bnb quantize
|
| 8 |
+
CUDA_VISIBLE_DEVICES=0 swift export \
|
| 9 |
+
--model output/swift_test_bert_merged \
|
| 10 |
+
--output_dir output/swift_test_bert_bnb_int4 \
|
| 11 |
+
--quant_bits 4 \
|
| 12 |
+
--quant_method bnb
|
| 13 |
+
|
| 14 |
+
# infer
|
| 15 |
+
CUDA_VISIBLE_DEVICES=0 swift infer \
|
| 16 |
+
--model output/swift_test_bert_bnb_int4
|