hiyouga commited on
Commit
1581125
1 Parent(s): 36e0b29

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -4
README.md CHANGED
@@ -31,7 +31,11 @@ model = AutoModelForCausalLM.from_pretrained("hiyouga/baichuan-7b-sft", trust_re
31
  streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
32
 
33
  query = "晚上睡不着怎么办"
34
- template = "A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\nHuman: {}\nAssistant: "
 
 
 
 
35
 
36
  inputs = tokenizer([template.format(query)], return_tensors="pt")
37
  inputs = inputs.to("cuda")
@@ -41,7 +45,7 @@ generate_ids = model.generate(**inputs, max_new_tokens=256, streamer=streamer)
41
  You could also alternatively launch a CLI demo by using the script in https://github.com/hiyouga/LLaMA-Efficient-Tuning
42
 
43
  ```bash
44
- python src/cli_demo.py --model_name_or_path hiyouga/baichuan-7b-sft
45
  ```
46
 
47
  ---
@@ -49,10 +53,12 @@ python src/cli_demo.py --model_name_or_path hiyouga/baichuan-7b-sft
49
  You could reproduce our results with the following scripts using [LLaMA-Efficient-Tuning](https://github.com/hiyouga/LLaMA-Efficient-Tuning):
50
 
51
  ```bash
52
- CUDA_VISIBLE_DEVICES=0 python src/train_sft.py \
 
53
  --model_name_or_path baichuan-inc/baichuan-7B \
54
  --do_train \
55
  --dataset alpaca_gpt4_en,alpaca_gpt4_zh,codealpaca \
 
56
  --finetuning_type lora \
57
  --lora_rank 16 \
58
  --lora_target W_pack,o_proj,gate_proj,down_proj,up_proj \
@@ -80,4 +86,4 @@ Loss curve on training set:
80
  ![train](assets/training_loss.svg)
81
 
82
  Loss curve on evaluation set:
83
- ![eval](assets/eval_loss.svg)
 
31
  streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
32
 
33
  query = "晚上睡不着怎么办"
34
+ template = (
35
+ "A chat between a curious user and an artificial intelligence assistant. "
36
+ "The assistant gives helpful, detailed, and polite answers to the user's questions.\n"
37
+ "Human: {}\nAssistant: "
38
+ )
39
 
40
  inputs = tokenizer([template.format(query)], return_tensors="pt")
41
  inputs = inputs.to("cuda")
 
45
  You could also alternatively launch a CLI demo by using the script in https://github.com/hiyouga/LLaMA-Efficient-Tuning
46
 
47
  ```bash
48
+ python src/cli_demo.py --template default --model_name_or_path hiyouga/baichuan-7b-sft
49
  ```
50
 
51
  ---
 
53
  You could reproduce our results with the following scripts using [LLaMA-Efficient-Tuning](https://github.com/hiyouga/LLaMA-Efficient-Tuning):
54
 
55
  ```bash
56
+ CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \
57
+ --stage sft \
58
  --model_name_or_path baichuan-inc/baichuan-7B \
59
  --do_train \
60
  --dataset alpaca_gpt4_en,alpaca_gpt4_zh,codealpaca \
61
+ --template default \
62
  --finetuning_type lora \
63
  --lora_rank 16 \
64
  --lora_target W_pack,o_proj,gate_proj,down_proj,up_proj \
 
86
  ![train](assets/training_loss.svg)
87
 
88
  Loss curve on evaluation set:
89
+ ![eval](assets/eval_loss.svg)