Views
No views yet
pip install zipnn1# Use a pipeline as a high-level helper
2from transformers import pipeline
3from zipnn import zipnn_hf
4
5zipnn_hf()
6
7messages = [
8 {"role": "user", "content": "Who are you?"},
9]
10pipe = pipeline("text-generation", model="royleibov/solar-pro-preview-instruct-ZipNN-Compressed")
11pipe(messages)1# Load model directly
2from transformers import AutoTokenizer, AutoModelForCausalLM
3from zipnn import zipnn_hf
4
5zipnn_hf()
6
7tokenizer = AutoTokenizer.from_pretrained("royleibov/solar-pro-preview-instruct-ZipNN-Compressed")
8model = AutoModelForCausalLM.from_pretrained(
9 "royleibov/solar-pro-preview-instruct-ZipNN-Compressed",
10 device_map="cuda",
11 torch_dtype="auto",
12 trust_remote_code=True,
13)python zipnn_compress_path.py safetensors --model royleibov/solar-pro-preview-instruct-ZipNN-Compressed --hf_cachezipnn_hf() is added at the top of the file like in the example above.python zipnn_decompress_path.py --model royleibov/solar-pro-preview-instruct-ZipNN-Compressed --hf_cache<|im_start|>user
Please, introduce yourself.<|im_end|>
<|im_start|>assistant1# Install requirements
2# !pip install transformers==4.44.2 torch==2.3.1 flash_attn==2.5.8 accelerate==0.31.0
3
4# Load model
5import torch
6from transformers import AutoModelForCausalLM, AutoTokenizer
7from zipnn import zipnn_hf
8
9zipnn_hf()
10
11tokenizer = AutoTokenizer.from_pretrained("royleibov/solar-pro-preview-instruct-ZipNN-Compressed")
12model = AutoModelForCausalLM.from_pretrained(
13 "royleibov/solar-pro-preview-instruct-ZipNN-Compressed",
14 device_map="cuda",
15 torch_dtype="auto",
16 trust_remote_code=True,
17)
18# Apply chat template
19messages = [
20 {"role": "user", "content": "Please, introduce yourself."},
21]
22prompt = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
23# Generate text
24outputs = model.generate(prompt, max_new_tokens=512)
25print(tokenizer.decode(outputs[0]))| Solar-pro-preview | Phi-3-medium-4K-instruct | Phi-3.5-MoE-instruct | Gemma 2 27B IT | Llama-3.1-8B-instruct | Llama-3.1-70B-instruct | |
|---|---|---|---|---|---|---|
| Release Date | 2024.09.08 | 2024.05.02 | 2024.08.20 | 2024.06.25 | 2024.06.18 | 2024.06.16 |
| Model size | 22B | 14B | 41.9B (6.6B) | 27B | 8B | 70B |
| License | MIT | MIT | MIT | gemma | llama3.1 | llama3.1 |
| MMLU | 79.14 | 78.02 | 78.66 | 76.13 | 68.25 | 82.09 |
| MMLU Pro | 52.11 | 47.51 | 46.99 | 45.68 | 37.88 | 53.01 |
| IFEval | 84.37 | 64.37 | 69.15 | 75.36 | 77.40 | 84.13 |
| ARC-C | 68.86 | 66.55 | 68.34 | 74.06 | 60.24 | 70.39 |
| GPQA | 36.38 | 35.78 | 34.38 | 36.38 | 35.26 | 41.06 |
| HellaSwag | 86.36 | 85.68 | 85.97 | 86.02 | 80.08 | 86.42 |
| EQBench | 77.91 | 76.78 | 77.22 | 80.32 | 65.80 | 82.52 |
| BigBench Hard | 67.31 | 63.09 | 62.58 | 64.88 | 51.06 | 69.54 |
| MUSR | 45.85 | 42.28 | 46.79 | 45.67 | 29.68 | 47.22 |
| GSM8K | 89.69 | 84.76 | 82.26 | 62.85 | 75.97 | 92.12 |
| MBPP | 61.59 | 60.27 | N/A (*) | 63.08 | 52.20 | 65.51 |
| Evaluation setting | Metric | Evaluation tool | |
|---|---|---|---|
| MMLU | 5-shot | macro_avg / acc | lm-eval-harness #928e8bb |
| MMLU Pro | 5-shot | macro_avg / acc | lm-eval-harness #928e8bb |
| IFEval | 0-shot, chat_template | mean of prompt_level_strict_acc and instruction_level_strict_acc | lm-eval-harness #928e8bb |
| ARC-C | 25-shot | acc_norm | lm-eval-harness #928e8bb |
| GPQA | 0-shot | acc_norm | lm-eval-harness #928e8bb |
| HellaSwag | 10-shot | acc_norm | lm-eval-harness #928e8bb |
| EQBench | 0-shot, chat_template | eqbench score | lm-eval-harness #928e8bb |
| BigBench Hard | 3-shot | macro_avg / acc_norm | lm-eval-harness #928e8bb |
| MUSR | 0-shot | macro_avg / acc_norm | lm-eval-harness #928e8bb |
| GSM8K | 8-shot, CoT | acc, exact_match & strict_extract | lm-eval-harness #928e8bb |
| MBPP | 0-shot | pass@1 | bigcode-evaluation-harness #0f3e95f |