8BitStudio commited on
Commit
871f0c8
·
verified ·
1 Parent(s): fa03aac

Add Sekai-1 chat model weights, tokenizer and How to use section

Browse files
README.md CHANGED
@@ -25,6 +25,36 @@ All scores are zero-shot. Sekai-1's scores were measured locally on the same tas
25
  **Pretraining:** 58.5B tokens of web, educational, math, code and conversation data, with a warmup-stable-decay schedule. The final ~12B tokens were a decay phase on a higher-quality mix.
26
  **Chat fine-tuning (SFT):** about 400M tokens of instruction following, everyday chat, short and long answers, summarizing and rewriting, code writing and code fixing, plus a small set of identity examples, so the model knows it is Sekai-1. It does not use chain-of-thought (a model this size doesn't benefit from it), and refusals were filtered out of the data.
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  ## Limitations
29
 
30
  Sekai-1 is a 95.6M-parameter model. It makes factual mistakes, loses track in long conversations, and is weak at multi-step reasoning and math beyond simple arithmetic.
 
25
  **Pretraining:** 58.5B tokens of web, educational, math, code and conversation data, with a warmup-stable-decay schedule. The final ~12B tokens were a decay phase on a higher-quality mix.
26
  **Chat fine-tuning (SFT):** about 400M tokens of instruction following, everyday chat, short and long answers, summarizing and rewriting, code writing and code fixing, plus a small set of identity examples, so the model knows it is Sekai-1. It does not use chain-of-thought (a model this size doesn't benefit from it), and refusals were filtered out of the data.
27
 
28
+ ## How to use
29
+
30
+ ```bash
31
+ pip install transformers torch
32
+ ```
33
+
34
+ ```python
35
+ from transformers import AutoModelForCausalLM, AutoTokenizer
36
+
37
+ model_id = "8BitStudio/Sekai-1"
38
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
39
+ model = AutoModelForCausalLM.from_pretrained(model_id)
40
+
41
+ messages = [{"role": "user", "content": "Who are you?"}]
42
+ inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_dict=True, return_tensors="pt")
43
+ outputs = model.generate(**inputs)
44
+ print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
45
+ ```
46
+
47
+ The model is small enough to run on a CPU. The default sampling settings (temperature 0.5, top-p 0.9, top-k 40, repetition penalty 1.1) are stored in `generation_config.json`; pass `do_sample=False` to `generate()` for deterministic answers.
48
+
49
+ Sekai-1 uses the ChatML format:
50
+
51
+ ```
52
+ <|im_start|>user
53
+ What is the capital of France?<|im_end|>
54
+ <|im_start|>assistant
55
+ Paris<|im_end|>
56
+ ```
57
+
58
  ## Limitations
59
 
60
  Sekai-1 is a 95.6M-parameter model. It makes factual mistakes, loses track in long conversations, and is weak at multi-step reasoning and math beyond simple arithmetic.
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,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "bos_token_id": 0,
8
+ "dtype": "float32",
9
+ "eos_token_id": 2,
10
+ "head_dim": 64,
11
+ "hidden_act": "silu",
12
+ "hidden_size": 576,
13
+ "initializer_range": 0.02,
14
+ "intermediate_size": 1536,
15
+ "layer_types": [
16
+ "full_attention",
17
+ "full_attention",
18
+ "full_attention",
19
+ "full_attention",
20
+ "full_attention",
21
+ "full_attention",
22
+ "full_attention",
23
+ "full_attention",
24
+ "full_attention",
25
+ "full_attention",
26
+ "full_attention",
27
+ "full_attention",
28
+ "full_attention",
29
+ "full_attention",
30
+ "full_attention",
31
+ "full_attention",
32
+ "full_attention",
33
+ "full_attention",
34
+ "full_attention",
35
+ "full_attention",
36
+ "full_attention",
37
+ "full_attention",
38
+ "full_attention"
39
+ ],
40
+ "max_position_embeddings": 2048,
41
+ "max_window_layers": 28,
42
+ "model_type": "qwen3",
43
+ "num_attention_heads": 9,
44
+ "num_hidden_layers": 23,
45
+ "num_key_value_heads": 3,
46
+ "pad_token_id": 0,
47
+ "rms_norm_eps": 1e-06,
48
+ "rope_parameters": {
49
+ "rope_theta": 10000.0,
50
+ "rope_type": "default"
51
+ },
52
+ "sliding_window": null,
53
+ "tie_word_embeddings": true,
54
+ "transformers_version": "5.15.1",
55
+ "use_cache": true,
56
+ "use_sliding_window": false,
57
+ "vocab_size": 24576,
58
+ "rope_theta": 10000.0,
59
+ "torch_dtype": "float32"
60
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 0,
3
+ "do_sample": true,
4
+ "eos_token_id": [
5
+ 2,
6
+ 0
7
+ ],
8
+ "max_new_tokens": 512,
9
+ "min_p": 0.02,
10
+ "pad_token_id": 0,
11
+ "repetition_penalty": 1.1,
12
+ "temperature": 0.5,
13
+ "top_k": 40,
14
+ "top_p": 0.9,
15
+ "transformers_version": "5.15.1"
16
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8f959f9f068128c8dc3d15620f1eb9f785857548b5b57eaf36180f2630ea907
3
+ size 382354208
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<|endoftext|>",
3
+ "clean_up_tokenization_spaces": false,
4
+ "eos_token": "<|im_end|>",
5
+ "model_max_length": 2048,
6
+ "pad_token": "<|endoftext|>",
7
+ "tokenizer_class": "PreTrainedTokenizerFast",
8
+ "unk_token": "<|endoftext|>",
9
+ "model_input_names": [
10
+ "input_ids",
11
+ "attention_mask"
12
+ ],
13
+ "additional_special_tokens": [
14
+ "<|im_start|>",
15
+ "<|im_end|>",
16
+ "<|reserved_0|>",
17
+ "<|reserved_1|>",
18
+ "<|reserved_2|>",
19
+ "<|reserved_3|>",
20
+ "<|reserved_4|>"
21
+ ],
22
+ "chat_template": "{{ bos_token }}{% for message in messages %}{{ '<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n' }}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}"
23
+ }