lrl-modelcloud
commited on
Commit
•
e4aa287
1
Parent(s):
4507947
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- gptq
|
4 |
+
- 4bit
|
5 |
+
- int4
|
6 |
+
- gptqmodel
|
7 |
+
- modelcloud
|
8 |
+
- llama-3.1
|
9 |
+
- 70b
|
10 |
+
- instruct
|
11 |
+
---
|
12 |
+
This model has been quantized using [GPTQModel](https://github.com/ModelCloud/GPTQModel).
|
13 |
+
|
14 |
+
- **bits**: 4
|
15 |
+
- **group_size**: 128
|
16 |
+
- **desc_act**: true
|
17 |
+
- **static_groups**: false
|
18 |
+
- **sym**: true
|
19 |
+
- **lm_head**: false
|
20 |
+
- **damp_percent**: 0.01
|
21 |
+
- **true_sequential**: true
|
22 |
+
- **model_name_or_path**: ""
|
23 |
+
- **model_file_base_name**: "model"
|
24 |
+
- **quant_method**: "gptq"
|
25 |
+
- **checkpoint_format**: "gptq"
|
26 |
+
- **meta**:
|
27 |
+
- **quantizer**: "gptqmodel:0.9.9-dev0"
|
28 |
+
|
29 |
+
**Here is an example:**
|
30 |
+
```python
|
31 |
+
from transformers import AutoTokenizer
|
32 |
+
from gptqmodel import GPTQModel
|
33 |
+
|
34 |
+
model_name = "ModelCloud/Meta-Llama-3.1-70B-Instruct-gptq-4bit"
|
35 |
+
|
36 |
+
prompt = [{"role": "user", "content": "I am in Shanghai, preparing to visit the natural history museum. Can you tell me the best way to"}]
|
37 |
+
|
38 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
39 |
+
|
40 |
+
model = GPTQModel.from_quantized(model_name)
|
41 |
+
|
42 |
+
input_tensor = tokenizer.apply_chat_template(prompt, add_generation_prompt=True, return_tensors="pt")
|
43 |
+
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=100)
|
44 |
+
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
|
45 |
+
|
46 |
+
print(result)
|
47 |
+
```
|