TentaFlow commited on
Commit
57d8b5d
·
verified ·
1 Parent(s): 18e8652

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - pl
5
+ base_model:
6
+ - speakleash/Bielik-4.5B-v3.0-Instruct
7
+ pipeline_tag: text-generation
8
+ library_name: transformers
9
+ tags:
10
+ - bielik
11
+ - polish
12
+ - nvfp4
13
+ - fp4
14
+ - compressed-tensors
15
+ - vllm
16
+ - quantized
17
+ ---
18
+
19
+ # Bielik-4.5B-v3.0-Instruct — NVFP4 (W4A4)
20
+
21
+ Kwantyzacja **NVFP4 (W4A4)** modelu [speakleash/Bielik-4.5B-v3.0-Instruct](https://huggingface.co/speakleash/Bielik-4.5B-v3.0-Instruct),
22
+ w formacie `compressed-tensors` (`nvfp4-pack-quantized`) gotowym do **vLLM**.
23
+
24
+ - **Wagi:** 4-bit (FP4 E2M1), grupy po 16, blokowe skale FP8 (E4M3) + globalna skala FP32
25
+ - **Aktywacje:** 4-bit FP4 (dynamiczne, per-grupa)
26
+ - **Pominięte:** `lm_head` (pełna precyzja)
27
+ - **Rozmiar:** ~8,9 GB (bf16) → **~2,7 GB**
28
+
29
+ ## Kalibracja
30
+
31
+ PTQ przez [`llm-compressor`](https://github.com/vllm-project/llm-compressor), 512 próbek polskiej Wikipedii,
32
+ długość sekwencji 2048. Kalibracja na polskim tekście dla zachowania jakości w języku docelowym.
33
+
34
+ ## Sprzęt
35
+
36
+ NVFP4 jest akcelerowany sprzętowo na **Blackwellu (sm_100+)**. Na starszych GPU (np. Ada/RTX 4090) vLLM
37
+ ładuje model przez kernel **Marlin (weight-only FP4)** — działa wszędzie, zysk to mniejszy VRAM.
38
+
39
+ ## Użycie (vLLM)
40
+
41
+ ```bash
42
+ vllm serve <repo>/Bielik-4.5B-v3.0-Instruct-NVFP4 --max-model-len 8192
43
+ ```
44
+
45
+ ## Licencja i atrybucja
46
+
47
+ Apache-2.0, dziedziczona z modelu bazowego (SpeakLeash & ACK Cyfronet AGH).
48
+ Ten checkpoint to wyłącznie kwantyzacja oryginalnych wag.
chat_template.jinja ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {{bos_token}}{% for message in messages %}{{'<|im_start|>' + message['role'] + '
2
+ ' + message['content'] + '<|im_end|>' + '
3
+ '}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant
4
+ ' }}{% endif %}
config.json ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": true,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 1,
8
+ "dtype": "bfloat16",
9
+ "eos_token_id": [
10
+ 4,
11
+ 2
12
+ ],
13
+ "head_dim": 128,
14
+ "hidden_act": "silu",
15
+ "hidden_size": 2048,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 11008,
18
+ "max_position_embeddings": 32768,
19
+ "mlp_bias": true,
20
+ "model_type": "llama",
21
+ "num_attention_heads": 16,
22
+ "num_hidden_layers": 60,
23
+ "num_key_value_heads": 2,
24
+ "pad_token_id": 2,
25
+ "pretraining_tp": 1,
26
+ "quantization_config": {
27
+ "config_groups": {
28
+ "group_0": {
29
+ "format": "nvfp4-pack-quantized",
30
+ "input_activations": {
31
+ "actorder": null,
32
+ "block_structure": null,
33
+ "dynamic": "local",
34
+ "group_size": 16,
35
+ "num_bits": 4,
36
+ "observer": "static_minmax",
37
+ "observer_kwargs": {},
38
+ "scale_dtype": "torch.float8_e4m3fn",
39
+ "strategy": "tensor_group",
40
+ "symmetric": true,
41
+ "type": "float",
42
+ "zp_dtype": null
43
+ },
44
+ "output_activations": null,
45
+ "targets": [
46
+ "Linear"
47
+ ],
48
+ "weights": {
49
+ "actorder": null,
50
+ "block_structure": null,
51
+ "dynamic": false,
52
+ "group_size": 16,
53
+ "num_bits": 4,
54
+ "observer": "memoryless_minmax",
55
+ "observer_kwargs": {},
56
+ "scale_dtype": "torch.float8_e4m3fn",
57
+ "strategy": "tensor_group",
58
+ "symmetric": true,
59
+ "type": "float",
60
+ "zp_dtype": null
61
+ }
62
+ }
63
+ },
64
+ "format": "nvfp4-pack-quantized",
65
+ "global_compression_ratio": null,
66
+ "ignore": [
67
+ "lm_head"
68
+ ],
69
+ "kv_cache_scheme": null,
70
+ "quant_method": "compressed-tensors",
71
+ "quantization_status": "compressed",
72
+ "sparsity_config": {},
73
+ "transform_config": {},
74
+ "version": "0.14.0.1"
75
+ },
76
+ "rms_norm_eps": 1e-06,
77
+ "rope_scaling": null,
78
+ "rope_theta": 1000000,
79
+ "tie_word_embeddings": false,
80
+ "transformers_version": "4.57.6",
81
+ "use_cache": true,
82
+ "vocab_size": 32000
83
+ }
generation_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 1,
4
+ "eos_token_id": [
5
+ 4,
6
+ 2
7
+ ],
8
+ "pad_token_id": 2,
9
+ "transformers_version": "4.57.6"
10
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ade2e3c74ba846f4f4a5f7aa9fa1b31874bd2b9dc1cc34fec82f8c63039e7966
3
+ size 2867458640
recipe.yaml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ default_stage:
2
+ default_modifiers:
3
+ QuantizationModifier:
4
+ targets: [Linear]
5
+ ignore: [lm_head]
6
+ scheme: NVFP4
7
+ bypass_divisibility_checks: false
special_tokens_map.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|im_start|>",
4
+ "<|im_end|>",
5
+ "<tool_call>",
6
+ "</tool_call>"
7
+ ],
8
+ "bos_token": {
9
+ "content": "<s>",
10
+ "lstrip": false,
11
+ "normalized": false,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ },
15
+ "eos_token": {
16
+ "content": "<|im_end|>",
17
+ "lstrip": false,
18
+ "normalized": false,
19
+ "rstrip": false,
20
+ "single_word": false
21
+ },
22
+ "pad_token": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false
28
+ },
29
+ "unk_token": {
30
+ "content": "<unk>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false
35
+ }
36
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "add_prefix_space": null,
5
+ "added_tokens_decoder": {
6
+ "0": {
7
+ "content": "<unk>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false,
12
+ "special": true
13
+ },
14
+ "1": {
15
+ "content": "<s>",
16
+ "lstrip": false,
17
+ "normalized": false,
18
+ "rstrip": false,
19
+ "single_word": false,
20
+ "special": true
21
+ },
22
+ "2": {
23
+ "content": "</s>",
24
+ "lstrip": false,
25
+ "normalized": false,
26
+ "rstrip": false,
27
+ "single_word": false,
28
+ "special": true
29
+ },
30
+ "3": {
31
+ "content": "<|im_start|>",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false,
36
+ "special": true
37
+ },
38
+ "4": {
39
+ "content": "<|im_end|>",
40
+ "lstrip": false,
41
+ "normalized": false,
42
+ "rstrip": false,
43
+ "single_word": false,
44
+ "special": true
45
+ },
46
+ "5": {
47
+ "content": "<tool_call>",
48
+ "lstrip": false,
49
+ "normalized": false,
50
+ "rstrip": false,
51
+ "single_word": false,
52
+ "special": true
53
+ },
54
+ "6": {
55
+ "content": "</tool_call>",
56
+ "lstrip": false,
57
+ "normalized": false,
58
+ "rstrip": false,
59
+ "single_word": false,
60
+ "special": true
61
+ }
62
+ },
63
+ "additional_special_tokens": [
64
+ "<|im_start|>",
65
+ "<|im_end|>",
66
+ "<tool_call>",
67
+ "</tool_call>"
68
+ ],
69
+ "bos_token": "<s>",
70
+ "clean_up_tokenization_spaces": false,
71
+ "eos_token": "<|im_end|>",
72
+ "extra_special_tokens": {},
73
+ "legacy": true,
74
+ "model_max_length": 1000000000000000019884624838656,
75
+ "pad_token": "</s>",
76
+ "sp_model_kwargs": {},
77
+ "spaces_between_special_tokens": false,
78
+ "tokenizer_class": "LlamaTokenizerFast",
79
+ "unk_token": "<unk>",
80
+ "use_default_system_prompt": false
81
+ }