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