-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
967d8f0
commit 581a404
Showing
12 changed files
with
94 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# merge-lora | ||
CUDA_VISIBLE_DEVICES=0 swift export \ | ||
--adapters swift/test_bert \ | ||
--output_dir output/swift_test_bert_merged \ | ||
--merge_lora true | ||
|
||
# bnb quantize | ||
CUDA_VISIBLE_DEVICES=0 swift export \ | ||
--model output/swift_test_bert_merged \ | ||
--output_dir output/swift_test_bert_bnb_int4 \ | ||
--quant_bits 4 \ | ||
--quant_method bnb | ||
|
||
# infer | ||
CUDA_VISIBLE_DEVICES=0 swift infer \ | ||
--model output/swift_test_bert_bnb_int4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# merge-lora | ||
CUDA_VISIBLE_DEVICES=0 swift export \ | ||
--adapters swift/test_bert \ | ||
--output_dir output/swift_test_bert_merged \ | ||
--merge_lora true | ||
|
||
# gptq quantize | ||
CUDA_VISIBLE_DEVICES=0 swift export \ | ||
--model output/swift_test_bert_merged \ | ||
--load_data_args true \ | ||
--output_dir output/swift_test_bert_gptq_int4 \ | ||
--quant_bits 4 \ | ||
--quant_method gptq \ | ||
--max_length 512 | ||
|
||
# infer | ||
CUDA_VISIBLE_DEVICES=0 swift infer \ | ||
--model output/swift_test_bert_gptq_int4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# bnb quantize | ||
CUDA_VISIBLE_DEVICES=0 swift export \ | ||
--model Shanghai_AI_Laboratory/internlm2-1_8b-reward \ | ||
--output_dir output/internlm2-1_8b-reward-bnb-int4 \ | ||
--quant_bits 4 \ | ||
--quant_method bnb | ||
|
||
# infer | ||
CUDA_VISIBLE_DEVICES=0 swift infer \ | ||
--model output/internlm2-1_8b-reward-bnb-int4 \ | ||
--val_dataset 'AI-ModelScope/alpaca-gpt4-data-zh#1000' \ | ||
--max_batch_size 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# gptq quantize | ||
CUDA_VISIBLE_DEVICES=0 swift export \ | ||
--model Shanghai_AI_Laboratory/internlm2-1_8b-reward \ | ||
--output_dir output/internlm2-1_8b-reward-gptq-int4 \ | ||
--quant_bits 4 \ | ||
--quant_method gptq \ | ||
--dataset 'AI-ModelScope/alpaca-gpt4-data-zh#1000' 'AI-ModelScope/alpaca-gpt4-data-en#1000' | ||
|
||
# infer | ||
CUDA_VISIBLE_DEVICES=0 swift infer \ | ||
--model output/internlm2-1_8b-reward-gptq-int4 \ | ||
--val_dataset 'AI-ModelScope/alpaca-gpt4-data-zh#1000' \ | ||
--max_batch_size 16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters