yukiontheiceberg commited on
Commit
8aec4ce
1 Parent(s): 39950d3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -1
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
- # Put inference section here.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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