oxfrug commited on
Commit
5eff7f3
·
verified ·
1 Parent(s): 5756345

Card on 5.0bpw

Browse files
Files changed (1) hide show
  1. README.md +64 -63
README.md CHANGED
@@ -1,70 +1,71 @@
1
  ---
 
2
  language:
3
  - sv
4
  - da
5
- - 'no'
6
- license: llama3
7
- base_model: AI-Sweden-Models/Llama-3-8B
 
 
 
 
 
 
 
8
  ---
9
 
10
- # Checkpoint 1
11
-
12
- ## Training setup
13
- The training was perfomed on the [LUMI supercomputer](https://lumi-supercomputer.eu/) within the [DeployAI EU project](https://www.ai.se/en/project/deployai).
14
- Based of the base model [AI-Sweden-Models/Llama-3-8B](https://huggingface.co/AI-Sweden-Models/Llama-3-8B).
15
-
16
- ## How to use
17
-
18
- ```python
19
- import transformers
20
- import torch
21
-
22
- model_id = "AI-Sweden-Models/Llama-3-8B-instruct"
23
-
24
- pipeline = transformers.pipeline(
25
- "text-generation",
26
- model=model_id,
27
- model_kwargs={"torch_dtype": torch.bfloat16},
28
- device_map="auto",
29
- )
30
-
31
- messages = [
32
- {"role": "system", "content": "Du är en hjälpsam assistant som svarar klokt och vänligt."},
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
- ```python
52
- >>> "För att göra pannkakor behöver du följande ingredienser:
53
- - 1 kopp vetemjöl
54
- - 1 tesked bakpulver
55
- - 1/4 tesked salt
56
- - 1 kopp mjölk
57
- - 1 stort ägg
58
- - 2 matskedar smält smör eller olja
59
-
60
- För att börja, blanda vetemjölet, bakpulvret och saltet i en bunke. I en annan skål, vispa ihop mjölken, ägget och smöret eller oljan.
61
- Tillsätt de våta ingredienserna till de torra ingredienserna och blanda tills det är väl blandat.
62
- Låt smeten vila i cirka 10 minuter.
63
-
64
- För att göra pannkakorna, värm en non-stick-panna eller stekpanna över medelvärme.
65
- När den är varm, häll smeten på pannan och grädda tills kanterna börjar torka ut och toppen är fast.
66
- Vänd pannkakan med en stekspade och grädda den andra sidan tills den är gyllenbrun.
67
- Upprepa med resten av smeten.
68
-
69
- När det gäller 5+6 är svaret 11."
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.