File size: 1,161 Bytes
79ae8f1
 
9cc88f2
 
 
79ae8f1
9cc88f2
fe66d6f
9cc88f2
 
 
 
0b3a75a
9cc88f2
f4b9dec
9cc88f2
0b3a75a
9cc88f2
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
license: agpl-3.0
language:
- zh
- en
---
# 使用方法
本模型使用educhat-sft-002-data-osm数据,从[BELLE](https://huggingface.co/BelleGroup/BELLE-LLaMA-EXT-7B)训练得到,由于LLaMA对其衍生模型的限制,发布的权重只能包含差异部分,使用前请先按照以下流程转换权重。
## Step1:将原始LLaMA权重转换为huggingface版本。
首先下载LLaMA原始权重,然后使用[权重转换脚本](https://github.com/huggingface/transformers/blob/main/src/transformers/models/llama/convert_llama_weights_to_hf.py)转换权重。
```python
python src/transformers/models/llama/convert_llama_weights_to_hf.py \
    --input_dir /path/to/downloaded/llama/weights --model_size 7B --output_dir /output/LLaMA_hf/7B
```
## Step2:使用[解密脚本](https://github.com/icalk-nlp/EduChat/blob/main/decrypt.py)将增量权重加到原始LLaMA权重上。
```python
python ./decrypt.py --base /path/to/LLAMA_hf/7B --target ./educhat-base-002-7b-decrypt --delta /path/to/educhat-base-002-7b 
```
# 使用示例
转换权重后,使用示例请参考:https://github.com/icalk-nlp/EduChat#%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B