blackwingedkite commited on
Commit
be65c68
1 Parent(s): 6725046

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -1,11 +1,18 @@
 
 
 
 
 
 
 
1
  !CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \
2
  --stage sft \
3
- --model_name_or_path THUDM/chatglm2-6b \ #ziqingyang/chinese-alpaca-2-7b
4
  --do_train \
5
  --dataset mydata \
6
  --template chatglm2 \
7
  --finetuning_type lora \
8
- --lora_target query_key_value \
9
  --output_dir ckpoint \
10
  --overwrite_cache \
11
  --auto_find_batch_size=False \
@@ -18,3 +25,7 @@
18
  --num_train_epochs 3.0 \
19
  --plot_loss \
20
  --fp16
 
 
 
 
 
1
+ from transformers import AutoModelForMaskedLM, AutoTokenizer
2
+ from huggingface_hub import notebook_login
3
+ notebook_login()
4
+ checkpoint = "ziqingyang/chinese-alpaca-2-7b"
5
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
6
+ model = AutoModelForMaskedLM.from_pretrained(checkpoint)
7
+
8
  !CUDA_VISIBLE_DEVICES=0 python src/train_bash.py \
9
  --stage sft \
10
+ --model_name_or_path model \
11
  --do_train \
12
  --dataset mydata \
13
  --template chatglm2 \
14
  --finetuning_type lora \
15
+ --lora_target q_proj,v_proj \
16
  --output_dir ckpoint \
17
  --overwrite_cache \
18
  --auto_find_batch_size=False \
 
25
  --num_train_epochs 3.0 \
26
  --plot_loss \
27
  --fp16
28
+
29
+
30
+ model.push_to_hub("gutalk_classification")
31
+ tokenizer.push_to_hub("gutalk_classification")