Update README.md
Browse files
README.md
CHANGED
@@ -14,6 +14,8 @@ pipeline_tag: text-generation
|
|
14 |
|
15 |
This repo contains AWQ model files for [KARAKURI LM 70B Chat v0.1](https://huggingface.co/karakuri-ai/karakuri-lm-70b-chat-v0.1).
|
16 |
|
|
|
|
|
17 |
I created AWQ model files by using used autoawq==0.2.3.
|
18 |
```bash
|
19 |
pip install autoawq==0.2.3
|
@@ -38,4 +40,27 @@ model.quantize(tokenizer, quant_config=quant_config, calib_data="mmnga/wikipedia
|
|
38 |
quant_path = "karakuri-lm-70b-v0.1-AWQ"
|
39 |
model.save_quantized(quant_path)
|
40 |
tokenizer.save_pretrained(quant_path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
```
|
|
|
14 |
|
15 |
This repo contains AWQ model files for [KARAKURI LM 70B Chat v0.1](https://huggingface.co/karakuri-ai/karakuri-lm-70b-chat-v0.1).
|
16 |
|
17 |
+
## How to get the AWQ model
|
18 |
+
|
19 |
I created AWQ model files by using used autoawq==0.2.3.
|
20 |
```bash
|
21 |
pip install autoawq==0.2.3
|
|
|
40 |
quant_path = "karakuri-lm-70b-v0.1-AWQ"
|
41 |
model.save_quantized(quant_path)
|
42 |
tokenizer.save_pretrained(quant_path)
|
43 |
+
```
|
44 |
+
|
45 |
+
## Usage
|
46 |
+
|
47 |
+
```bash
|
48 |
+
from vllm import LLM, SamplingParams
|
49 |
+
|
50 |
+
sampling_params = SamplingParams(temperature=0.0, max_tokens=100)
|
51 |
+
llm = LLM(model="masao1211/karakuri-lm-70b-chat-v0.1-AWQ", max_model_len=4096)
|
52 |
+
|
53 |
+
system_prompt = "System prompt"
|
54 |
+
|
55 |
+
|
56 |
+
messages = [{"role": "system", "content": "System prompt"}]
|
57 |
+
messages.append({"role": "user", "content": "User Prompt"})
|
58 |
+
prompt = llm.llm_engine.tokenizer.tokenizer.apply_chat_template(conversation=messages, add_generation_prompt=True, tokenize=False)
|
59 |
+
prompts = [prompt]
|
60 |
+
|
61 |
+
outputs = llm.generate(prompts, sampling_params)
|
62 |
+
for output in outputs:
|
63 |
+
prompt = output.prompt
|
64 |
+
generated_text = output.outputs[0].text
|
65 |
+
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
|
66 |
```
|