-
Notifications
You must be signed in to change notification settings - Fork 427
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
1f1abf4
commit 1f0668d
Showing
8 changed files
with
67 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CUDA_VISIBLE_DEVICES=0 \ | ||
swift deploy \ | ||
--model output/vx-xxx/checkpoint-xxx \ | ||
--served_model_name bert-base-chinese bert-base-chinese | ||
|
||
# curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{ | ||
# "model": "bert-base-chinese", | ||
# "messages": [{"role": "user", "content": "Task: Sentiment Classification\nSentence: 包装差,容易被调包。\nCategory: negative, positive\nOutput:"}], | ||
# "temperature": 0 | ||
# }' |
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,5 @@ | ||
CUDA_VISIBLE_DEVICES=0 \ | ||
swift infer \ | ||
--model output/vx-xxx/checkpoint-xxx \ | ||
--load_data_args true \ | ||
--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,24 @@ | ||
# If `num_labels` is provided, it will be considered a classification task, | ||
# and AutoModelForSequenceClassification will be used to load the model. | ||
# The BERT model does not require templates, so it can usually be used without registration. | ||
CUDA_VISIBLE_DEVICES=0 \ | ||
swift sft \ | ||
--model AI-ModelScope/bert-base-chinese \ | ||
--train_type full \ | ||
--dataset 'DAMO_NLP/jd:cls#2000' \ | ||
--torch_dtype bfloat16 \ | ||
--num_train_epochs 1 \ | ||
--per_device_train_batch_size 1 \ | ||
--per_device_eval_batch_size 1 \ | ||
--learning_rate 1e-4 \ | ||
--gradient_accumulation_steps 16 \ | ||
--eval_steps 50 \ | ||
--save_steps 50 \ | ||
--save_total_limit 2 \ | ||
--logging_steps 5 \ | ||
--max_length 512 \ | ||
--output_dir output \ | ||
--warmup_ratio 0.05 \ | ||
--dataloader_num_workers 4 \ | ||
--num_labels 2 \ | ||
--task_type seq_cls |
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,9 @@ | ||
CUDA_VISIBLE_DEVICES=0 \ | ||
swift deploy \ | ||
--adapters output/vx-xxx/checkpoint-xxx | ||
|
||
# curl http://localhost:8000/v1/chat/completions -H "Content-Type: application/json" -d '{ | ||
# "model": "Qwen2.5-7B", | ||
# "messages": [{"role": "user", "content": "Task: Sentiment Classification\nSentence: 包装差,容易被调包。\nCategory: negative, positive\nOutput:"}], | ||
# "temperature": 0 | ||
# }' |
1 change: 0 additions & 1 deletion
1
examples/train/seq_cls/infer.sh → examples/train/seq_cls/qwen2_5/infer.sh
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
CUDA_VISIBLE_DEVICES=0 \ | ||
swift infer \ | ||
--adapters output/vx-xxx/checkpoint-xxx \ | ||
--max_new_tokens 2048 \ | ||
--load_data_args true \ | ||
--max_batch_size 16 |
File renamed without changes.
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