Update README.md
Browse files
README.md
CHANGED
|
@@ -96,7 +96,21 @@ We provide step-by-step reproducation tutorials for tech enthusiasts, AI practit
|
|
| 96 |
## LLM360 Developer Suite
|
| 97 |
We provide step-by-step finetuning tutorials for tech enthusiasts, AI practitioners and academic or industry researchers here [llm360.ai/pretraining].
|
| 98 |
|
| 99 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
|
| 102 |
|
|
|
|
| 96 |
## LLM360 Developer Suite
|
| 97 |
We provide step-by-step finetuning tutorials for tech enthusiasts, AI practitioners and academic or industry researchers here [llm360.ai/pretraining].
|
| 98 |
|
| 99 |
+
# Loading K2
|
| 100 |
+
```python
|
| 101 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 102 |
+
|
| 103 |
+
tokenizer = AutoTokenizer.from_pretrained("LLM360/K2")
|
| 104 |
+
model = AutoModelForCausalLM.from_pretrained("LLM360/K2")
|
| 105 |
+
|
| 106 |
+
prompt = 'int add(int x, int y) {'
|
| 107 |
+
|
| 108 |
+
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
|
| 109 |
+
gen_tokens = model.generate(input_ids, do_sample=True, max_length=128)
|
| 110 |
+
|
| 111 |
+
print("-"*20 + "Output for model" + 20 * '-')
|
| 112 |
+
print(tokenizer.batch_decode(gen_tokens)[0])
|
| 113 |
+
```
|
| 114 |
|
| 115 |
|
| 116 |
|