File size: 4,049 Bytes
acd8406
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---

base_model: EXAONE-3.0-7.8B-Instruct
license: other
license_name: exaone
license_link: LICENSE
language:
- en
- ko
tags:
- lg-ai
- exaone
quantized_by: LG-AI-EXAONE
---


<p align="center">
<img src="assets/EXAONE_Symbol+BI_3d.png", width="300", style="margin: 40 auto;">
<br>

# EXAONE-3.0-7.8B-Instruct-AWQ

## Introduction

We introduce EXAONE-3.0-7.8B-Instruct-AWQ, a quantized version of EXAONE-3.0-7.8B-Instruct. The model uses the AWQ technique for group-wise 4-bit weight-only quantization (W4A16g128).
 
For more details on EXAONE-3.0-7.8B-Instruct, please refer to [EXAONE-3.0-7.8B-Instruct](https://huggingface.co/LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct).

## Quickstart

To use this quantized model, please install the `transformers` library with EXAONE support, which is available on [our transformers fork](https://github.com/lgai-exaone/transformers/tree/add-exaone).
Also, please install `awq` library from [our autoawq fork](https://github.com/lgai-exaone/AutoAWQ/tree/add-exaone).

```bash

pip install git+https://github.com/lgai-exaone/transformers.git@add-exaone

pip install git+https://github.com/lgai-exaone/AutoAWQ.git@add-exaone

```

Here is an example code:

```python

import torch

from awq import AutoAWQForCausalLM

from transformers import AutoTokenizer



model = AutoAWQForCausalLM.from_pretrained(

    "LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct-AWQ",

    torch_dtype=torch.float16,

    device_map="auto"

)

tokenizer = AutoTokenizer.from_pretrained("LGAI-EXAONE/EXAONE-3.0-7.8B-Instruct-AWQ")



prompt = "Explain how wonderful you are"



messages = [

    {"role": "system", 

     "content": "You are EXAONE model from LG AI Research, a helpful assistant."},

    {"role": "user", "content": prompt},

]

input_ids = tokenizer.apply_chat_template(

    messages,

    tokenize=True,

    add_generation_prompt=True,

    return_tensors="pt",

)



output = model.generate(

    input_ids.to("cuda"),

    eos_token_id=tokenizer.eos_token_id,

    max_new_tokens=128,

)

print(tokenizer.decode(output[0]))

```

> ### Note
> The EXAONE 3.0 instruction-tuned language model was trained to utilize the system prompt, 
> so we highly recommend using the system prompts provided in the code snippet above.

## Limitation

The EXAONE language model has certain limitations and may occasionally generate inappropriate responses. The language model generates responses based on the output probability of tokens, and it is determined during learning from training data. While we have made every effort to exclude personal, harmful, and biased information from the training data, some problematic content may still be included, potentially leading to undesirable responses. Please note that the text generated by EXAONE language model does not reflects the views of LG AI Research.

- Inappropriate answers may be generated, which contain personal, harmful or other inappropriate information.
- Biased responses may be generated, which are associated with age, gender, race, and so on.
- The generated responses rely heavily on statistics from the training data, which can result in the generation of
semantically or syntactically incorrect sentences.
- Since the model does not reflect the latest information, the responses may be false or contradictory.

LG AI Research strives to reduce potential risks that may arise from EXAONE language model. Users are not allowed
to engage in any malicious activities (e.g., keying in illegal information) that may induce the creation of inappropriate
outputs violating LG AI’s ethical principles when using EXAONE language model.

## License

The model is licensed under [EXAONE AI Model License Agreement 1.1 - NC](./LICENSE)

## Citation
 
```

@article{exaone-3.0-7.8B-instruct,

  title={EXAONE 3.0 7.8B Instruction Tuned Language Model},

  author={LG AI Research},

  journal={arXiv preprint arXiv:2408.03541},

  year={2024}

}

```

## Contact
LG AI Research Technical Support: contact[email protected]