cistine commited on
Commit
35bcbb5
1 Parent(s): 985922b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -16
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
- torch.set_default_device("cuda")
84
-
85
- model = AutoModelForCausalLM.from_pretrained("opencsg/opencsg-phi-2-v0.1", torch_dtype="auto", trust_remote_code=True)
86
- tokenizer = AutoTokenizer.from_pretrained("opencsg/opencsg-phi-2-v0.1", trust_remote_code=True)
87
-
88
- inputs = tokenizer('''def print_prime(n):
89
- """
90
- Print all primes between 1 and n
91
- """''', return_tensors="pt", return_attention_mask=False)
92
-
93
- outputs = model.generate(**inputs, max_length=200)
94
- text = tokenizer.batch_decode(outputs)[0]
95
- print(text)
96
  ```
97
 
98
  # Training
@@ -145,7 +146,8 @@ opencsg-stable-code-3b-v1是是一系列基于stable-code-3b的通过全参数
145
 
146
  | 模型大小 | 基座模型 |
147
  | --- | ----------------------------------------------------------------------------- |
148
- | 3B |[opencsg/Opencsg-stable-coder-3b-v1](https://huggingface.co/opencsg/opencsg-stable-code-3b-v1)
 
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
  ## 模型评估