shibing624
commited on
Commit
•
4591571
1
Parent(s):
81e8855
Update README.md
Browse files
README.md
CHANGED
@@ -28,22 +28,22 @@ The overall performance of chatglm-6b-csc-zh-lora on CSC **test**:
|
|
28 |
|
29 |
## Usage
|
30 |
|
31 |
-
本项目开源在
|
32 |
|
33 |
Install package:
|
34 |
```shell
|
35 |
-
pip install -U
|
36 |
```
|
37 |
|
38 |
```python
|
39 |
-
from
|
40 |
model = ChatGlmModel("chatglm", "THUDM/chatglm-6b", lora_name="shibing624/chatglm-6b-csc-zh-lora")
|
41 |
r = model.predict(["对下面中文拼写纠错:\n少先队员因该为老人让坐。\n答:"])
|
42 |
print(r) # ['少先队员应该为老人让座。\n错误字:因,坐']
|
43 |
```
|
44 |
|
45 |
## Usage (HuggingFace Transformers)
|
46 |
-
Without [
|
47 |
|
48 |
First, you pass your input through the transformer model, then you get the generated sentence.
|
49 |
|
@@ -93,19 +93,16 @@ chatglm-6b-csc-zh-lora
|
|
93 |
|
94 |
|
95 |
|
96 |
-
如果需要训练ChatGLM模型,请参考[https://github.com/shibing624/
|
97 |
|
98 |
|
99 |
## Citation
|
100 |
|
101 |
```latex
|
102 |
-
@software{
|
103 |
author = {Xu Ming},
|
104 |
-
title = {
|
105 |
-
year = {
|
106 |
-
url = {https://github.com/shibing624/
|
107 |
}
|
108 |
```
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
28 |
|
29 |
## Usage
|
30 |
|
31 |
+
本项目开源在textgen项目:[textgen](https://github.com/shibing624/textgen),可支持ChatGLM原生模型和LoRA微调后的模型,通过如下命令调用:
|
32 |
|
33 |
Install package:
|
34 |
```shell
|
35 |
+
pip install -U textgen
|
36 |
```
|
37 |
|
38 |
```python
|
39 |
+
from textgen import ChatGlmModel
|
40 |
model = ChatGlmModel("chatglm", "THUDM/chatglm-6b", lora_name="shibing624/chatglm-6b-csc-zh-lora")
|
41 |
r = model.predict(["对下面中文拼写纠错:\n少先队员因该为老人让坐。\n答:"])
|
42 |
print(r) # ['少先队员应该为老人让座。\n错误字:因,坐']
|
43 |
```
|
44 |
|
45 |
## Usage (HuggingFace Transformers)
|
46 |
+
Without [textgen](https://github.com/shibing624/textgen), you can use the model like this:
|
47 |
|
48 |
First, you pass your input through the transformer model, then you get the generated sentence.
|
49 |
|
|
|
93 |
|
94 |
|
95 |
|
96 |
+
如果需要训练ChatGLM模型,请参考[https://github.com/shibing624/textgen](https://github.com/shibing624/textgen)
|
97 |
|
98 |
|
99 |
## Citation
|
100 |
|
101 |
```latex
|
102 |
+
@software{textgen,
|
103 |
author = {Xu Ming},
|
104 |
+
title = {textgen: Implementation of language model finetune},
|
105 |
+
year = {2021},
|
106 |
+
url = {https://github.com/shibing624/textgen},
|
107 |
}
|
108 |
```
|
|
|
|
|
|