Add pipeline_tag and improve usage snippets
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- en
|
| 4 |
license: apache-2.0
|
|
|
|
|
|
|
| 5 |
tags:
|
| 6 |
- quantization
|
| 7 |
- sinq
|
|
@@ -11,7 +14,6 @@ tags:
|
|
| 11 |
- qwen
|
| 12 |
- llm
|
| 13 |
- compression
|
| 14 |
-
base_model: Qwen/Qwen3-14B
|
| 15 |
base_model_relation: quantized
|
| 16 |
---
|
| 17 |
|
|
@@ -48,7 +50,7 @@ To support the project please put a star ⭐ in the official [SINQ](https://gith
|
|
| 48 |
|
| 49 |
---
|
| 50 |
|
| 51 |
-
# 🚀 Usage
|
| 52 |
|
| 53 |
## Prerequisite
|
| 54 |
Before running the quantization script, make sure the **SINQ** library is installed.
|
|
@@ -58,6 +60,7 @@ Installation instructions and setup details are available in the [SINQ official
|
|
| 58 |
You can load and use the model with our wrapper based on the 🤗 Transformers library:
|
| 59 |
|
| 60 |
```python
|
|
|
|
| 61 |
from transformers import AutoTokenizer
|
| 62 |
from sinq.patch_model import AutoSINQHFModel
|
| 63 |
|
|
@@ -74,7 +77,6 @@ inputs = tokenizer(prompt, return_tensors="pt").to("cuda:0")
|
|
| 74 |
with torch.inference_mode():
|
| 75 |
out_ids = sinq_model.generate(**inputs, max_new_tokens=32, do_sample=False)
|
| 76 |
print(tokenizer.decode(out_ids[0], skip_special_tokens=True))
|
| 77 |
-
|
| 78 |
```
|
| 79 |
|
| 80 |
<details>
|
|
@@ -83,6 +85,7 @@ print(tokenizer.decode(out_ids[0], skip_special_tokens=True))
|
|
| 83 |
The quantized model was obtained using the **SINQ** quantization library, following the steps below:
|
| 84 |
|
| 85 |
```python
|
|
|
|
| 86 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 87 |
from sinq.patch_model import AutoSINQHFModel
|
| 88 |
from sinq.sinqlinear import BaseQuantizeConfig
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: Qwen/Qwen3-14B
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
license: apache-2.0
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
library_name: sinq
|
| 8 |
tags:
|
| 9 |
- quantization
|
| 10 |
- sinq
|
|
|
|
| 14 |
- qwen
|
| 15 |
- llm
|
| 16 |
- compression
|
|
|
|
| 17 |
base_model_relation: quantized
|
| 18 |
---
|
| 19 |
|
|
|
|
| 50 |
|
| 51 |
---
|
| 52 |
|
| 53 |
+
# 🚀 Usage
|
| 54 |
|
| 55 |
## Prerequisite
|
| 56 |
Before running the quantization script, make sure the **SINQ** library is installed.
|
|
|
|
| 60 |
You can load and use the model with our wrapper based on the 🤗 Transformers library:
|
| 61 |
|
| 62 |
```python
|
| 63 |
+
import torch
|
| 64 |
from transformers import AutoTokenizer
|
| 65 |
from sinq.patch_model import AutoSINQHFModel
|
| 66 |
|
|
|
|
| 77 |
with torch.inference_mode():
|
| 78 |
out_ids = sinq_model.generate(**inputs, max_new_tokens=32, do_sample=False)
|
| 79 |
print(tokenizer.decode(out_ids[0], skip_special_tokens=True))
|
|
|
|
| 80 |
```
|
| 81 |
|
| 82 |
<details>
|
|
|
|
| 85 |
The quantized model was obtained using the **SINQ** quantization library, following the steps below:
|
| 86 |
|
| 87 |
```python
|
| 88 |
+
import torch
|
| 89 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 90 |
from sinq.patch_model import AutoSINQHFModel
|
| 91 |
from sinq.sinqlinear import BaseQuantizeConfig
|