Update README.md
Browse files
README.md
CHANGED
@@ -42,7 +42,8 @@ This is the repository for the base 3B version finetuned based on [stable-code-3
|
|
42 |
|
43 |
| Model Size | Base Model |
|
44 |
| --- | ----------------------------------------------------------------------------- |
|
45 |
-
| 3B|[opencsg/Opencsg-stable-coder-3b-v1](https://huggingface.co/opencsg/opencsg-stable-code-3b-v1)
|
|
|
46 |
|
47 |
|
48 |
## Model Eval
|
@@ -79,20 +80,20 @@ To simplify the comparison, we chosed the Pass@1 metric for the Python language,
|
|
79 |
```
|
80 |
import torch
|
81 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
inputs = tokenizer(
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
print(
|
96 |
```
|
97 |
|
98 |
# Training
|
@@ -145,7 +146,8 @@ opencsg-stable-code-3b-v1是是一系列基于stable-code-3b的通过全参数
|
|
145 |
|
146 |
| 模型大小 | 基座模型 |
|
147 |
| --- | ----------------------------------------------------------------------------- |
|
148 |
-
| 3B
|
|
|
149 |
|
150 |
|
151 |
## 模型评估
|
|
|
42 |
|
43 |
| Model Size | Base Model |
|
44 |
| --- | ----------------------------------------------------------------------------- |
|
45 |
+
| 3B |[opencsg/Opencsg-stable-coder-3b-v1](https://huggingface.co/opencsg/opencsg-stable-code-3b-v1)|
|
46 |
+
| opencsg-phi-2-v0.1 | [opencsg/Opencsg-phi-2-v0.1](https://huggingface.co/opencsg/opencsg-phi-2-v0.1) |
|
47 |
|
48 |
|
49 |
## Model Eval
|
|
|
80 |
```
|
81 |
import torch
|
82 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
83 |
+
tokenizer = AutoTokenizer.from_pretrained("opencsg/opencsg-stable-coder-3b-v1")
|
84 |
+
model = AutoModelForCausalLM.from_pretrained(
|
85 |
+
"opencsg/opencsg-stable-coder-3b-v1",
|
86 |
+
torch_dtype="auto",
|
87 |
+
)
|
88 |
+
model.cuda()
|
89 |
+
inputs = tokenizer("import torch\nimport torch.nn as nn", return_tensors="pt").to(model.device)
|
90 |
+
tokens = model.generate(
|
91 |
+
**inputs,
|
92 |
+
max_new_tokens=48,
|
93 |
+
temperature=0.2,
|
94 |
+
do_sample=True,
|
95 |
+
)
|
96 |
+
print(tokenizer.decode(tokens[0], skip_special_tokens=True))
|
97 |
```
|
98 |
|
99 |
# Training
|
|
|
146 |
|
147 |
| 模型大小 | 基座模型 |
|
148 |
| --- | ----------------------------------------------------------------------------- |
|
149 |
+
| 3B|[opencsg/Opencsg-stable-coder-3b-v1](https://huggingface.co/opencsg/opencsg-stable-code-3b-v1)|
|
150 |
+
| opencsg-phi-2-v0.1 | [opencsg/Opencsg-phi-2-v0.1](https://huggingface.co/opencsg/opencsg-phi-2-v0.1) |
|
151 |
|
152 |
|
153 |
## 模型评估
|