From c3fcb674865cf50c80ffeb48aeb2b01a7c9aa252 Mon Sep 17 00:00:00 2001 From: hiyouga Date: Thu, 20 Jul 2023 17:23:16 +0800 Subject: [PATCH] Update README.md --- README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 73acb0d3..6e2d8539 100644 --- a/README.md +++ b/README.md @@ -263,34 +263,55 @@ use_cpu: false ```bash CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \ - --stage pt \ + --stage sft \ --model_name_or_path path_to_your_model \ --do_eval \ --dataset alpaca_gpt4_en \ + --finetuning_type lora \ --checkpoint_dir path_to_checkpoint \ --output_dir path_to_eval_result \ --per_device_eval_batch_size 8 \ - --max_samples 50 \ + --max_samples 100 \ --predict_with_generate ``` We recommend using `--per_device_eval_batch_size=1` and `--max_target_length 128` at 4/8-bit evaluation. +### Predict + +```bash +CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \ + --stage sft \ + --model_name_or_path path_to_your_model \ + --do_predict \ + --dataset alpaca_gpt4_en \ + --finetuning_type lora \ + --checkpoint_dir path_to_checkpoint \ + --output_dir path_to_predict_result \ + --per_device_eval_batch_size 8 \ + --max_samples 100 \ + --predict_with_generate +``` + +If you want to predict the samples with empty responses, please kindly fill the `response` column with **dummy tokens** to ensure the sample will not be discarded throughout the preprocessing phase. + ### API Demo ```bash python src/api_demo.py \ --model_name_or_path path_to_your_model \ + --finetuning_type lora \ --checkpoint_dir path_to_checkpoint ``` -See `http://localhost:8000/docs` for API documentation. +Visit `http://localhost:8000/docs` for API documentation. ### CLI Demo ```bash python src/cli_demo.py \ --model_name_or_path path_to_your_model \ + --finetuning_type lora \ --checkpoint_dir path_to_checkpoint ``` @@ -299,6 +320,7 @@ python src/cli_demo.py \ ```bash python src/web_demo.py \ --model_name_or_path path_to_your_model \ + --finetuning_type lora \ --checkpoint_dir path_to_checkpoint ``` @@ -307,6 +329,7 @@ python src/web_demo.py \ ```bash python src/export_model.py \ --model_name_or_path path_to_your_model \ + --finetuning_type lora \ --checkpoint_dir path_to_checkpoint \ --output_dir path_to_export ```