Update README.md
Browse files
README.md
CHANGED
@@ -1 +1,36 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
```bash
|
2 |
+
pip install numpy gekko pandas
|
3 |
+
|
4 |
+
git clone https://github.com/PanQiWei/AutoGPTQ.git && cd AutoGPTQ
|
5 |
+
|
6 |
+
pip install -vvv --no-build-isolation -e .
|
7 |
+
```
|
8 |
+
|
9 |
+
```python
|
10 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
11 |
+
from transformers import AutoTokenizer, TextStreamer
|
12 |
+
|
13 |
+
model = AutoGPTQForCausalLM.from_quantized(
|
14 |
+
"GSJL/Qwen2.5-14B-Instruct-GPTQ-Marlin",
|
15 |
+
use_marlin=True
|
16 |
+
).to("cuda:0")
|
17 |
+
|
18 |
+
tokenizer = AutoTokenizer.from_pretrained(save_dir, use_fast = True)
|
19 |
+
streamer = TextStreamer(tokenizer, skip_prompt = True, skip_special_tokens=True)
|
20 |
+
|
21 |
+
prompt = [{"role":"user","content":"Hi mom!!!!!"}]
|
22 |
+
|
23 |
+
inputs = tokenizer.apply_chat_template(
|
24 |
+
prompt,
|
25 |
+
return_tensors="pt",
|
26 |
+
add_generation_prompt = True
|
27 |
+
).to("cuda:0")
|
28 |
+
|
29 |
+
output = model.generate(
|
30 |
+
input_ids = inputs,
|
31 |
+
streamer = streamer,
|
32 |
+
use_cache=True,
|
33 |
+
do_sample = True,
|
34 |
+
max_new_tokens = 600
|
35 |
+
)
|
36 |
+
```
|