Views
No views yet
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model = AutoModelForCausalLM.from_pretrained("cyberagent/open-calm-large", device_map="auto", torch_dtype=torch.float16)
5tokenizer = AutoTokenizer.from_pretrained("cyberagent/open-calm-large")
6
7inputs = tokenizer("AIによって私達の暮らしは、", return_tensors="pt").to(model.device)
8with torch.no_grad():
9 tokens = model.generate(
10 **inputs,
11 max_new_tokens=64,
12 do_sample=True,
13 temperature=0.7,
14 top_p=0.9,
15 repetition_penalty=1.05,
16 pad_token_id=tokenizer.pad_token_id,
17 )
18
19output = tokenizer.decode(tokens[0], skip_special_tokens=True)
20print(output)| Model | Params | Layers | Dim | Heads | Dev ppl |
|---|---|---|---|---|---|
| cyberagent/open-calm-small | 160M | 12 | 768 | 12 | 19.7 |
| cyberagent/open-calm-medium | 400M | 24 | 1024 | 16 | 13.8 |
| cyberagent/open-calm-large | 830M | 24 | 1536 | 16 | 11.3 |
| cyberagent/open-calm-1b | 1.4B | 24 | 2048 | 16 | 10.3 |
| cyberagent/open-calm-3b | 2.7B | 32 | 2560 | 32 | 9.7 |
| cyberagent/open-calm-7b | 6.8B | 32 | 4096 | 32 | 8.2 |
1@software{gpt-neox-library,
2 title = {{GPT-NeoX: Large Scale Autoregressive Language Modeling in PyTorch}},
3 author = {Andonian, Alex and Anthony, Quentin and Biderman, Stella and Black, Sid and Gali, Preetham and Gao, Leo and Hallahan, Eric and Levy-Kramer, Josh and Leahy, Connor and Nestler, Lucas and Parker, Kip and Pieler, Michael and Purohit, Shivanshu and Songz, Tri and Phil, Wang and Weinbach, Samuel},
4 url = {https://www.github.com/eleutherai/gpt-neox},
5 doi = {10.5281/zenodo.5879544},
6 month = {8},
7 year = {2021},
8 version = {0.0.1},
9}