Add use this model
Browse files
README.md
CHANGED
@@ -16,20 +16,36 @@ library_name: transformers
|
|
16 |
|
17 |
This model is a clone of [**ibm-granite/granite-7b-instruct**](https://huggingface.co/ibm-granite/granite-7b-instruct) compressed using ZipNN. Compressed losslessly to 67% its original size, ZipNN saved ~5GB in storage and potentially ~30TB in data transfer **monthly**.
|
18 |
|
19 |
-
|
20 |
|
21 |
In order to use the model, ZipNN is necessary:
|
22 |
```bash
|
23 |
pip install zipnn
|
24 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
27 |
```python
|
|
|
|
|
28 |
from zipnn import zipnn_hf
|
29 |
|
30 |
zipnn_hf()
|
|
|
|
|
|
|
31 |
```
|
32 |
-
And continue as usual. The patch will take care of decompressing the model correctly and safely.
|
33 |
|
34 |
# Model Card for Granite-7b-lab [Paper](https://arxiv.org/abs/2403.01081)
|
35 |
|
|
|
16 |
|
17 |
This model is a clone of [**ibm-granite/granite-7b-instruct**](https://huggingface.co/ibm-granite/granite-7b-instruct) compressed using ZipNN. Compressed losslessly to 67% its original size, ZipNN saved ~5GB in storage and potentially ~30TB in data transfer **monthly**.
|
18 |
|
19 |
+
### Requirement
|
20 |
|
21 |
In order to use the model, ZipNN is necessary:
|
22 |
```bash
|
23 |
pip install zipnn
|
24 |
```
|
25 |
+
### Use This Model
|
26 |
+
```python
|
27 |
+
# Use a pipeline as a high-level helper
|
28 |
+
from transformers import pipeline
|
29 |
+
from zipnn import zipnn_hf
|
30 |
+
|
31 |
+
zipnn_hf()
|
32 |
|
33 |
+
messages = [
|
34 |
+
{"role": "user", "content": "Who are you?"},
|
35 |
+
]
|
36 |
+
pipe = pipeline("text-generation", model="royleibov/granite-7b-instruct-ZipNN-Compressed")
|
37 |
+
pipe(messages)
|
38 |
+
```
|
39 |
```python
|
40 |
+
# Load model directly
|
41 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
42 |
from zipnn import zipnn_hf
|
43 |
|
44 |
zipnn_hf()
|
45 |
+
|
46 |
+
tokenizer = AutoTokenizer.from_pretrained("royleibov/granite-7b-instruct-ZipNN-Compressed")
|
47 |
+
model = AutoModelForCausalLM.from_pretrained("royleibov/granite-7b-instruct-ZipNN-Compressed")
|
48 |
```
|
|
|
49 |
|
50 |
# Model Card for Granite-7b-lab [Paper](https://arxiv.org/abs/2403.01081)
|
51 |
|