devorah-ai-2016 commited on
Commit
a85f567
·
verified ·
1 Parent(s): 3ea490a

(Trained with Unsloth)

Browse files
chat_template.jinja CHANGED
@@ -1,8 +1,70 @@
1
- {{ bos_token }}{% if messages[0]['role'] == 'system' %}{{'<start_of_turn>user
2
- ' + messages[0]['content'] | trim + ' ' + messages[1]['content'] | trim + '<end_of_turn>
3
- '}}{% set messages = messages[2:] %}{% endif %}{% for message in messages %}{% if message['role'] == 'user' %}{{'<start_of_turn>user
4
- ' + message['content'] | trim + '<end_of_turn>
5
- '}}{% elif message['role'] == 'assistant' %}{{'<start_of_turn>model
6
- ' + message['content'] | trim + '<end_of_turn>
7
- ' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<start_of_turn>model
8
- ' }}{% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}{%- macro strip_thinking(text) -%}
2
+ {%- set ns = namespace(result='') -%}
3
+ {%- for part in text.split('<channel|>') -%}
4
+ {%- if '<|channel>' in part -%}
5
+ {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}
6
+ {%- else -%}
7
+ {%- set ns.result = ns.result + part -%}
8
+ {%- endif -%}
9
+ {%- endfor -%}
10
+ {{- ns.result | trim -}}
11
+ {%- endmacro -%}
12
+ {%- set thinking = enable_thinking is defined and enable_thinking -%}
13
+ {%- set loop_messages = messages -%}
14
+ {%- if messages[0]['role'] in ['system', 'developer'] or thinking -%}
15
+ {{ '<|turn>system
16
+ ' }}
17
+ {%- if thinking -%}
18
+ {{ '<|think|>
19
+ ' }}
20
+ {%- endif -%}
21
+ {%- if messages[0]['role'] in ['system', 'developer'] -%}
22
+ {{ messages[0]['content'] | trim }}
23
+ {%- set loop_messages = messages[1:] -%}
24
+ {%- endif -%}
25
+ {{ '<turn|>
26
+ ' }}
27
+ {%- endif -%}
28
+ {%- for message in loop_messages -%}
29
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
30
+ {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
31
+ {%- endif -%}
32
+ {%- if (message['role'] == 'assistant') -%}
33
+ {%- set role = "model" -%}
34
+ {%- else -%}
35
+ {%- set role = message['role'] -%}
36
+ {%- endif -%}
37
+ {{ '<|turn>' + role + '
38
+ ' }}
39
+ {%- if message['content'] is string -%}
40
+ {%- if role == "model" -%}
41
+ {{ strip_thinking(message['content']) }}
42
+ {%- else -%}
43
+ {{ message['content'] | trim }}
44
+ {%- endif -%}
45
+ {%- elif message['content'] is iterable -%}
46
+ {%- for item in message['content'] -%}
47
+ {%- if item['type'] == 'audio' -%}
48
+ {{ '<|audio|>' }}
49
+ {%- elif item['type'] == 'image' -%}
50
+ {{ '<|image|>' }}
51
+ {%- elif item['type'] == 'video' -%}
52
+ {{ '<|video|>' }}
53
+ {%- elif item['type'] == 'text' -%}
54
+ {%- if role == "model" -%}
55
+ {{ strip_thinking(item['text']) }}
56
+ {%- else -%}
57
+ {{ item['text'] | trim }}
58
+ {%- endif -%}
59
+ {%- endif -%}
60
+ {%- endfor -%}
61
+ {%- else -%}
62
+ {{ raise_exception("Invalid content type") }}
63
+ {%- endif -%}
64
+ {{ '<turn|>
65
+ ' }}
66
+ {%- endfor -%}
67
+ {%- if add_generation_prompt -%}
68
+ {{'<|turn>model
69
+ '}}
70
+ {%- endif -%}
config.json CHANGED
@@ -7,8 +7,11 @@
7
  "attn_logit_softcapping": 50.0,
8
  "bos_token_id": 2,
9
  "cache_implementation": "hybrid",
10
- "torch_dtype": "float16",
11
- "eos_token_id": 1,
 
 
 
12
  "final_logit_softcapping": 30.0,
13
  "head_dim": 256,
14
  "hidden_act": "gelu_pytorch_tanh",
@@ -55,8 +58,7 @@
55
  "rope_scaling": null,
56
  "rope_theta": 10000.0,
57
  "sliding_window": 4096,
58
- "transformers_version": "4.57.2",
59
- "unsloth_version": "2025.11.1",
60
  "use_cache": true,
61
  "vocab_size": 256000
62
  }
 
7
  "attn_logit_softcapping": 50.0,
8
  "bos_token_id": 2,
9
  "cache_implementation": "hybrid",
10
+ "torch_dtype": "bfloat16",
11
+ "eos_token_id": [
12
+ 1,
13
+ 107
14
+ ],
15
  "final_logit_softcapping": 30.0,
16
  "head_dim": 256,
17
  "hidden_act": "gelu_pytorch_tanh",
 
58
  "rope_scaling": null,
59
  "rope_theta": 10000.0,
60
  "sliding_window": 4096,
61
+ "unsloth_version": "2024.9",
 
62
  "use_cache": true,
63
  "vocab_size": 256000
64
  }
generation_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 2,
4
+ "eos_token_id": [
5
+ 1,
6
+ 1,
7
+ 107
8
+ ],
9
+ "max_length": 8192,
10
+ "pad_token_id": 0,
11
+ "transformers_version": "4.57.2"
12
+ }
special_tokens_map.json CHANGED
@@ -1,6 +1,34 @@
1
  {
2
- "bos_token": "<bos>",
3
- "eos_token": "<end_of_turn>",
4
- "pad_token": "<pad>",
5
- "unk_token": "<unk>"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  }
 
1
  {
2
+ "additional_special_tokens": [
3
+ "<start_of_turn>",
4
+ "<end_of_turn>"
5
+ ],
6
+ "bos_token": {
7
+ "content": "<bos>",
8
+ "lstrip": false,
9
+ "normalized": false,
10
+ "rstrip": false,
11
+ "single_word": false
12
+ },
13
+ "eos_token": {
14
+ "content": "<eos>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false
19
+ },
20
+ "pad_token": {
21
+ "content": "<pad>",
22
+ "lstrip": false,
23
+ "normalized": false,
24
+ "rstrip": false,
25
+ "single_word": false
26
+ },
27
+ "unk_token": {
28
+ "content": "<unk>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ }
34
  }
tokenizer.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:95a6ecc0c8b61e4f65249a9da9cf0809371813500854cfee2848a793cbdfb19b
3
  size 34362873
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5f7eee611703c5ce5d1eee32d9cdcfe465647b8aff0c1dfb3bed7ad7dbb05060
3
  size 34362873
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61a7b147390c64585d6c3543dd6fc636906c9af3865a5548f27f31aee1d4c8e2
3
+ size 4241003
tokenizer_config.json CHANGED
@@ -11,7 +11,7 @@
11
  "special": true
12
  },
13
  "1": {
14
- "content": "<end_of_turn>",
15
  "lstrip": false,
16
  "normalized": false,
17
  "rstrip": false,
@@ -859,7 +859,7 @@
859
  "special": true
860
  },
861
  "107": {
862
- "content": "<eos>",
863
  "lstrip": false,
864
  "normalized": false,
865
  "rstrip": false,
@@ -1995,13 +1995,21 @@
1995
  "special": false
1996
  }
1997
  },
 
 
 
 
1998
  "bos_token": "<bos>",
1999
  "clean_up_tokenization_spaces": false,
2000
- "eos_token": "<end_of_turn>",
2001
  "extra_special_tokens": {},
2002
  "model_max_length": 1000000000000000019884624838656,
2003
  "pad_token": "<pad>",
2004
- "tokenizer_class": "GemmaTokenizerFast",
 
 
 
2005
  "unk_token": "<unk>",
2006
- "chat_template": "{{ bos_token }}{% if messages[0]['role'] == 'system' %}{{'<start_of_turn>user\n' + messages[0]['content'] | trim + ' ' + messages[1]['content'] | trim + '<end_of_turn>\n'}}{% set messages = messages[2:] %}{% endif %}{% for message in messages %}{% if message['role'] == 'user' %}{{'<start_of_turn>user\n' + message['content'] | trim + '<end_of_turn>\n'}}{% elif message['role'] == 'assistant' %}{{'<start_of_turn>model\n' + message['content'] | trim + '<end_of_turn>\n' }}{% else %}{{ raise_exception('Only user and assistant roles are supported!') }}{% endif %}{% endfor %}{% if add_generation_prompt %}{{ '<start_of_turn>model\n' }}{% endif %}"
 
2007
  }
 
11
  "special": true
12
  },
13
  "1": {
14
+ "content": "<eos>",
15
  "lstrip": false,
16
  "normalized": false,
17
  "rstrip": false,
 
859
  "special": true
860
  },
861
  "107": {
862
+ "content": "<end_of_turn>",
863
  "lstrip": false,
864
  "normalized": false,
865
  "rstrip": false,
 
1995
  "special": false
1996
  }
1997
  },
1998
+ "additional_special_tokens": [
1999
+ "<start_of_turn>",
2000
+ "<end_of_turn>"
2001
+ ],
2002
  "bos_token": "<bos>",
2003
  "clean_up_tokenization_spaces": false,
2004
+ "eos_token": "<eos>",
2005
  "extra_special_tokens": {},
2006
  "model_max_length": 1000000000000000019884624838656,
2007
  "pad_token": "<pad>",
2008
+ "padding_side": "left",
2009
+ "sp_model_kwargs": {},
2010
+ "spaces_between_special_tokens": false,
2011
+ "tokenizer_class": "GemmaTokenizer",
2012
  "unk_token": "<unk>",
2013
+ "use_default_system_prompt": false,
2014
+ "chat_template": "{{ bos_token }}{%- macro strip_thinking(text) -%}\n {%- set ns = namespace(result='') -%}\n {%- for part in text.split('<channel|>') -%}\n {%- if '<|channel>' in part -%}\n {%- set ns.result = ns.result + part.split('<|channel>')[0] -%}\n {%- else -%}\n {%- set ns.result = ns.result + part -%}\n {%- endif -%}\n {%- endfor -%}\n {{- ns.result | trim -}}\n{%- endmacro -%}\n{%- set thinking = enable_thinking is defined and enable_thinking -%}\n{%- set loop_messages = messages -%}\n{%- if messages[0]['role'] in ['system', 'developer'] or thinking -%}\n {{ '<|turn>system\n' }}\n {%- if thinking -%}\n {{ '<|think|>\n' }}\n {%- endif -%}\n {%- if messages[0]['role'] in ['system', 'developer'] -%}\n {{ messages[0]['content'] | trim }}\n {%- set loop_messages = messages[1:] -%}\n {%- endif -%}\n {{ '<turn|>\n' }}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<|turn>' + role + '\n' }}\n {%- if message['content'] is string -%}\n {%- if role == \"model\" -%}\n {{ strip_thinking(message['content']) }}\n {%- else -%}\n {{ message['content'] | trim }}\n {%- endif -%}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'audio' -%}\n {{ '<|audio|>' }}\n {%- elif item['type'] == 'image' -%}\n {{ '<|image|>' }}\n {%- elif item['type'] == 'video' -%}\n {{ '<|video|>' }}\n {%- elif item['type'] == 'text' -%}\n {%- if role == \"model\" -%}\n {{ strip_thinking(item['text']) }}\n {%- else -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<turn|>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<|turn>model\n'}}\n{%- endif -%}\n"
2015
  }