Skip to content

Commit b5d10d9

Browse files
committed
fix bugs
1 parent 416cc90 commit b5d10d9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ git clone https://huggingface.co/jingyaogong/MiniMind2
225225

226226
```bash
227227
# load=0: load from pytorch model, load=1: load from transformers-hf model
228-
python eval_model.py --load 1
228+
python eval_model.py --load 1 --model_mode 2
229229
```
230230

231231
### 4.或启动WebUI

Diff for: README_en.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ git clone https://huggingface.co/jingyaogong/MiniMind2
239239

240240
```bash
241241
# load=0: load from pytorch model, load=1: load from transformers-hf model
242-
python eval_model.py --load 1
242+
python eval_model.py --load 1 --model_mode 2
243243
```
244244

245245
### 4. Or Start WebUI

Diff for: scripts/train_tokenizer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def read_texts_from_jsonl(file_path):
2525
data = json.loads(line)
2626
yield data['text']
2727

28-
data_path = '../dataset/tokenizer_train.jsonl'
28+
data_path = '../dataset/pretrain_hq.jsonl'
2929

3030
# 初始化tokenizer
3131
tokenizer = Tokenizer(models.BPE())
@@ -139,12 +139,12 @@ def eval_tokenizer():
139139
print('encoder长度:', len(model_inputs['input_ids']))
140140

141141
input_ids = model_inputs['input_ids']
142-
response = tokenizer.decode(input_ids, skip_special_tokens=True)
142+
response = tokenizer.decode(input_ids, skip_special_tokens=False)
143143
print('decoder和原始文本是否一致:', response == new_prompt)
144144

145145

146146
def main():
147-
# train_tokenizer()
147+
train_tokenizer()
148148
eval_tokenizer()
149149

150150

Diff for: train_distill_reason.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def train_epoch(epoch, wandb):
3535
# 思考标签占位符
3636
start_of_think_ids = tokenizer('<think>').input_ids
3737
end_of_think_ids = tokenizer('</think>').input_ids
38-
start_of_answer_ids = tokenizer('</answer>').input_ids
38+
start_of_answer_ids = tokenizer('<answer>').input_ids
3939
end_of_answer_ids = tokenizer('</answer>').input_ids
4040
loss_fct = nn.CrossEntropyLoss(reduction='none')
4141
start_time = time.time()

0 commit comments

Comments
 (0)