Views
No views yet
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline, set_seed
3
4model = AutoModelForCausalLM.from_pretrained("sbintuitions/sarashina2-13b", torch_dtype=torch.bfloat16, device_map="auto")
5tokenizer = AutoTokenizer.from_pretrained("sbintuitions/sarashina2-13b")
6# If you want to use slow tokenizer
7# tokenizer = AutoTokenizer.from_pretrained("sbintuitions/sarashina2-13b", use_fast=False)
8generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
9set_seed(123)
10
11text = generator(
12 "おはようございます、今日の天気は",
13 max_length=30,
14 do_sample=True,
15 pad_token_id=tokenizer.pad_token_id,
16 num_return_sequences=3,
17)
18
19for t in text:
20 print(t)
21 | Parameters | Vocab size | Training tokens | Architecture | Position type | Layers | Hidden dim | Attention heads |
|---|---|---|---|---|---|---|---|
| 7B | 102400 | 2.1T | Llama2 | RoPE | 32 | 4096 | 32 |
| 13B | 102400 | 2.1T | Llama2 | RoPE | 40 | 5120 | 40 |
| 70B | 102400 | 2.1T | Llama2 | RoPE | 80 | 8192 | 64 |