Card on 4.5bpw
Browse files
README.md
CHANGED
|
@@ -1,70 +1,71 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
language:
|
| 3 |
- sv
|
| 4 |
- da
|
| 5 |
-
-
|
| 6 |
-
|
| 7 |
-
base_model: AI-Sweden-Models/Llama-3-8B
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
{"role": "user", "content": "Hur gör man pannkakor? Och vad behöver man handla? Undrar också vad 5+6 är.."},
|
| 34 |
-
]
|
| 35 |
-
|
| 36 |
-
terminators = [
|
| 37 |
-
pipeline.tokenizer.eos_token_id,
|
| 38 |
-
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
| 39 |
-
]
|
| 40 |
-
|
| 41 |
-
outputs = pipeline(
|
| 42 |
-
messages,
|
| 43 |
-
max_new_tokens=256,
|
| 44 |
-
eos_token_id=terminators,
|
| 45 |
-
do_sample=True,
|
| 46 |
-
temperature=0.6,
|
| 47 |
-
top_p=0.9,
|
| 48 |
-
)
|
| 49 |
-
print(outputs[0]["generated_text"][-1])
|
| 50 |
```
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
-
|
| 57 |
-
-
|
| 58 |
-
- 2
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: llama3
|
| 3 |
language:
|
| 4 |
- sv
|
| 5 |
- da
|
| 6 |
+
- "no"
|
| 7 |
+
- en
|
| 8 |
+
base_model: AI-Sweden-Models/Llama-3-8B-instruct
|
| 9 |
+
base_model_relation: quantized
|
| 10 |
+
library_name: exllamav2
|
| 11 |
+
tags:
|
| 12 |
+
- exl2
|
| 13 |
+
- llama
|
| 14 |
+
- swedish
|
| 15 |
+
- quantized
|
| 16 |
---
|
| 17 |
|
| 18 |
+
# AI-Sweden Llama-3-8B-instruct — EXL2
|
| 19 |
+
|
| 20 |
+
ExLlamaV2 / EXL2 quants of [AI-Sweden-Models/Llama-3-8B-instruct](https://huggingface.co/AI-Sweden-Models/Llama-3-8B-instruct).
|
| 21 |
+
That checkpoint is a Swedish/Nordic instruct tune of Llama 3 8B. Official Hub files are BF16 (and a separate GGUF); there were no EXL2 uploads.
|
| 22 |
+
|
| 23 |
+
Converted with **ExLlamaV2 0.3.2**, `lm_head` at 6-bit, **built-in default calibration** (same recipe as turboderp-style quants). One measurement pass, then each bitrate from `measurement.json`.
|
| 24 |
+
|
| 25 |
+
## Branches
|
| 26 |
+
|
| 27 |
+
| Revision | Target bpw | Size (approx.) |
|
| 28 |
+
|---|---|---|
|
| 29 |
+
| [`4.0bpw`](../../tree/4.0bpw) | 4.0 | 4.7 GB |
|
| 30 |
+
| [`4.5bpw`](../../tree/4.5bpw) | 4.5 | 5.1 GB |
|
| 31 |
+
| [`5.0bpw`](../../tree/5.0bpw) | 5.0 | 5.5 GB |
|
| 32 |
+
| [`5.5bpw`](../../tree/5.5bpw) | 5.5 | 5.9 GB |
|
| 33 |
+
| [`6.0bpw`](../../tree/6.0bpw) | 6.0 | 6.3 GB |
|
| 34 |
+
|
| 35 |
+
[`measurement.json`](../../blob/main/measurement.json) is on `main` if you want to roll another bitrate yourself.
|
| 36 |
+
|
| 37 |
+
Download a revision:
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
hf download oxfrug/Llama-3-8B-instruct-exl2 --revision 5.0bpw --local-dir ./Llama-3-8B-instruct-exl2-5.0bpw
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
```
|
| 42 |
+
|
| 43 |
+
TabbyAPI / ExUI: point the model path at a checked-out branch, or set the HF revision to `5.0bpw`.
|
| 44 |
+
|
| 45 |
+
## Notes
|
| 46 |
+
|
| 47 |
+
- **License:** [Meta Llama 3 Community License](https://llama.meta.com/llama3/license). Keep the `NOTICE` file. This is a derivative of Meta Llama 3 via AI Sweden’s instruct tune.
|
| 48 |
+
- **Loader:** ExLlamaV2 (TabbyAPI, text-generation-webui `exllamav2`, ExUI). Not GGUF / llama.cpp.
|
| 49 |
+
- On **PyTorch 2.13** without Flash Attention 2.5.7+, set `config.no_sdpa = True` before load. Default SDPA + `causal_lower_right` produced collapsed output in our tests; the explicit matmul path matched BF16 (6.0bpw raw-EN first 16 tokens identical). Older torch + flash-attn (paged attention) is the usual community stack and was not the convert path.
|
| 50 |
+
- These are **not** the experimental Swedish-heavy calibration files. Default EXL2 cal is what other EXL2 repos ship.
|
| 51 |
+
|
| 52 |
+
## Source
|
| 53 |
+
|
| 54 |
+
```
|
| 55 |
+
AI-Sweden-Models/Llama-3-8B-instruct
|
| 56 |
+
← AI-Sweden-Models/Llama-3-8B
|
| 57 |
+
← meta-llama/Meta-Llama-3-8B
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Convert: ExLlamaV2 `convert.py` 0.3.2, RTX 3090.
|
| 61 |
+
|
| 62 |
+
## Smoke (greedy, `no_sdpa=True`)
|
| 63 |
+
|
| 64 |
+
6.0bpw, same chat template as the BF16 card:
|
| 65 |
+
|
| 66 |
+
| Prompt | Output |
|
| 67 |
+
|---|---|
|
| 68 |
+
| `Vad heter Sveriges huvudstad? Ett ord.` | `Huvudstaden i Sverige är Stockholm.` |
|
| 69 |
+
| `Name the capital of Sweden in one word.` | `Stockholm` |
|
| 70 |
+
|
| 71 |
+
4.0bpw is coherent on the same prompts (Swedish-first on the English question, like the BF16 base). This is not a leaderboard score.
|