uploaded readme
Browse files
README.md
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Quantization made by Richard Erkhov.
|
2 |
+
|
3 |
+
[Github](https://github.com/RichardErkhov)
|
4 |
+
|
5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
6 |
+
|
7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
8 |
+
|
9 |
+
|
10 |
+
LlamaXCoder-3.2-3B-Instruct - AWQ
|
11 |
+
- Model creator: https://huggingface.co/motexture/
|
12 |
+
- Original model: https://huggingface.co/motexture/LlamaXCoder-3.2-3B-Instruct/
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
Original model description:
|
18 |
+
---
|
19 |
+
license: apache-2.0
|
20 |
+
datasets:
|
21 |
+
- motexture/cData
|
22 |
+
language:
|
23 |
+
- en
|
24 |
+
- it
|
25 |
+
- es
|
26 |
+
base_model:
|
27 |
+
- meta-llama/Llama-3.2-3B-Instruct
|
28 |
+
pipeline_tag: text-generation
|
29 |
+
tags:
|
30 |
+
- coding
|
31 |
+
- coder
|
32 |
+
- model
|
33 |
+
- llama
|
34 |
+
---
|
35 |
+
|
36 |
+
# LlamaXCoder-3.2-3B-Instruct
|
37 |
+
|
38 |
+
## Introduction
|
39 |
+
|
40 |
+
LlamaXCoder-3.2-3B-Instruct is a fine-tuned version of meta-llama/Llama-3.2-3B-Instruct, trained on the cData coding dataset to improve its reasoning and coding ability.
|
41 |
+
|
42 |
+
## Quickstart
|
43 |
+
|
44 |
+
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
45 |
+
|
46 |
+
```python
|
47 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
48 |
+
device = "cuda" # the device to load the model onto
|
49 |
+
|
50 |
+
model = AutoModelForCausalLM.from_pretrained(
|
51 |
+
"motexture/LlamaXCoder-3.2-3B-Instruct",
|
52 |
+
torch_dtype="auto",
|
53 |
+
device_map="auto"
|
54 |
+
)
|
55 |
+
tokenizer = AutoTokenizer.from_pretrained("motexture/LlamaXCoder-3.2-3B-Instruct")
|
56 |
+
|
57 |
+
prompt = "Write a C++ program that prints Hello World!"
|
58 |
+
messages = [
|
59 |
+
{"role": "system", "content": "You are a helpful assistant."},
|
60 |
+
{"role": "user", "content": prompt}
|
61 |
+
]
|
62 |
+
text = tokenizer.apply_chat_template(
|
63 |
+
messages,
|
64 |
+
tokenize=False,
|
65 |
+
add_generation_prompt=True
|
66 |
+
)
|
67 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(device)
|
68 |
+
|
69 |
+
generated_ids = model.generate(
|
70 |
+
model_inputs.input_ids,
|
71 |
+
max_new_tokens=4096,
|
72 |
+
do_sample=True,
|
73 |
+
temperature=0.3
|
74 |
+
)
|
75 |
+
generated_ids = [
|
76 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
77 |
+
]
|
78 |
+
|
79 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
80 |
+
```
|
81 |
+
|
82 |
+
## License
|
83 |
+
|
84 |
+
[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
85 |
+
|