File size: 702 Bytes
1f28ab9
 
 
 
 
 
 
b3a134a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
---
# K2-Chat: a fully-reproducible large language model outperforming Llama 2 70B using 35% less compute

blurb

<center><img src="k2_chat_eval_table.png" alt="k2 eval table" /></center>

## Loading K2-Chat
# Loading K2
```python
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("LLM360/K2-Chat")
model = AutoModelForCausalLM.from_pretrained("LLM360/K2-Chat")

prompt = 'hi how are you doing'

input_ids = tokenizer(prompt, return_tensors="pt").input_ids
gen_tokens = model.generate(input_ids, do_sample=True, max_length=128)

print("-"*20 + "Output for model"  + 20 * '-')
print(tokenizer.batch_decode(gen_tokens)[0])
```