File size: 1,096 Bytes
7059378
 
 
 
 
 
 
 
 
598fe48
 
7059378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
---
license: apache-2.0
language:
- ja
- en
---
## Description
This model is a 13.5 billion parameter model that combines four sets of 16 layers each from [CALM2-7B](https://huggingface.co/cyberagent/calm2-7b).

## Note
This model is experimental and may not achieve expected performance without additional tuning.

## Tutorial
```python
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("sudy-super/baku-13b")
model = AutoModelForCausalLM.from_pretrained("sudy-super/baku-13b", device_map="auto", torch_dtype=torch.bfloat16)
prompt = "大規模言語モデルとは、"
token_ids = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
with torch.no_grad():
    output_ids = model.generate(
        token_ids.to(model.device),
        max_new_tokens=100,
        do_sample=True,
        temperature=0.8,
        pad_token_id=tokenizer.pad_token_id,
        bos_token_id=tokenizer.bos_token_id,
        eos_token_id=tokenizer.eos_token_id
    )
result = tokenizer.decode(output_ids.tolist()[0])
print(result)
```