Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1 |
---
|
2 |
license: bigcode-openrail-m
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: bigcode-openrail-m
|
3 |
---
|
4 |
+
|
5 |
+
## LoRDCoder v0 12.3B
|
6 |
+
|
7 |
+
Usage:
|
8 |
+
|
9 |
+
```
|
10 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
11 |
+
|
12 |
+
device = "cuda"
|
13 |
+
|
14 |
+
model = AutoModelForCausalLM.from_pretrained("nolanoAI/lordcoder-v0-12-3B", trust_remote_code=True).to(device)
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained("nolanoAI/lordcoder-v0-12-3B", trust_remote_code=True)
|
16 |
+
|
17 |
+
inputs = {k: v.to(device) for k,v in tokenizer('# PyTorch CNN on MNIST\nimport torch\n', return_tensors='pt').items()}
|
18 |
+
|
19 |
+
generated_ids = model.generate(
|
20 |
+
**inputs,
|
21 |
+
use_cache=True,
|
22 |
+
max_new_tokens=500,
|
23 |
+
temperature=0.1,
|
24 |
+
top_p=0.95,
|
25 |
+
do_sample=True,
|
26 |
+
eos_token_id=tokenizer.eos_token_id,
|
27 |
+
pad_token_id=tokenizer.eos_token_id, # model has no pad token
|
28 |
+
)
|
29 |
+
|
30 |
+
|
31 |
+
```
|