Views
No views yet
| Name | Quant method | Size |
|---|---|---|
| VinaLlama2-14B.Q2_K.gguf | Q2_K | 5.51GB |
| VinaLlama2-14B.IQ3_XS.gguf | IQ3_XS | 6.03GB |
| VinaLlama2-14B.IQ3_S.gguf | IQ3_S | 6.31GB |
| VinaLlama2-14B.Q3_K_S.gguf | Q3_K_S | 6.31GB |
| VinaLlama2-14B.IQ3_M.gguf | IQ3_M | 6.61GB |
| VinaLlama2-14B.Q3_K.gguf | Q3_K | 6.91GB |
| VinaLlama2-14B.Q3_K_M.gguf | Q3_K_M | 6.91GB |
| VinaLlama2-14B.Q3_K_L.gguf | Q3_K_L | 7.3GB |
| VinaLlama2-14B.IQ4_XS.gguf | IQ4_XS | 7.37GB |
| VinaLlama2-14B.Q4_0.gguf | Q4_0 | 7.62GB |
| VinaLlama2-14B.IQ4_NL.gguf | IQ4_NL | 7.68GB |
| VinaLlama2-14B.Q4_K_S.gguf | Q4_K_S | 7.98GB |
| VinaLlama2-14B.Q4_K.gguf | Q4_K | 8.56GB |
| VinaLlama2-14B.Q4_K_M.gguf | Q4_K_M | 8.56GB |
| VinaLlama2-14B.Q4_1.gguf | Q4_1 | 8.4GB |
| VinaLlama2-14B.Q5_0.gguf | Q5_0 | 9.18GB |
| VinaLlama2-14B.Q5_K_S.gguf | Q5_K_S | 9.34GB |
| VinaLlama2-14B.Q5_K.gguf | Q5_K | 9.81GB |
| VinaLlama2-14B.Q5_K_M.gguf | Q5_K_M | 9.81GB |
| VinaLlama2-14B.Q5_1.gguf | Q5_1 | 9.96GB |
| VinaLlama2-14B.Q6_K.gguf | Q6_K | 11.46GB |
| VinaLlama2-14B.Q8_0.gguf | Q8_0 | 14.03GB |
pip install transformers accelerate1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3device = "cuda" # the device to load the model onto
4
5model = AutoModelForCausalLM.from_pretrained(
6 "vilm/VinaLlama2-14B",
7 torch_dtype='auto',
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained("vilm/VinaLlama2-14B")
11
12prompt = "Một cộng một bằng mấy?"
13messages = [
14 {"role": "system", "content": "Bạn là trợ lí AI hữu ích."},
15 {"role": "user", "content": prompt}
16]
17text = tokenizer.apply_chat_template(
18 messages,
19 tokenize=False,
20 add_generation_prompt=True
21)
22model_inputs = tokenizer([text], return_tensors="pt").to(device)
23
24generated_ids = model.generate(
25 model_inputs.input_ids,
26 max_new_tokens=1024,
27 eos_token_id=tokenizer.eos_token_id,
28 temperature=0.25,
29)
30generated_ids = [
31 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
32]
33
34response = tokenizer.batch_decode(generated_ids)[0]
35print(response)