lbourdois commited on
Commit
369ea56
·
verified ·
1 Parent(s): 71ec1a2

Trimmed Slovenian 32768 tokens

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 1024,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": true,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pipeline_tag: sentence-similarity
3
+ language: slv
4
+ license: apache-2.0
5
+ tags:
6
+ - trimmed
7
+ library_name: sentence-transformers
8
+ base_model: Qwen/Qwen3-Embedding-0.6B
9
+ base_model_relation: quantized
10
+ datasets:
11
+ - Lumberjackk/fineweb-2-trimming
12
+ ---
13
+
14
+ # Qwen3-Embedding-slv-32768
15
+
16
+ This model is a **20.44% smaller** version of [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B) optimized for Slovenian language via vocabulary size reduction using the [trimming](https://huggingface.co/blog/introduction-to-trimming) method.
17
+
18
+ This trimmed model should perform similarly to the original model with only **32,768 tokens** and a much smaller memory footprint. However, it may not perform well for other languages as tokens not commonly used in Slovenian were removed from the vocabulary.
19
+
20
+ ## Model Statistics
21
+
22
+ | Metric | Original | Trimmed | Reduction |
23
+ |--------|----------|---------|-----------|
24
+ | **Vocabulary size** | 151,643 tokens | 32,768 tokens | **78.39%** |
25
+ | **Model size** | 595,776,512 params | 474,021,888 params | **20.44%** |
26
+
27
+ ![image](https://cdn-uploads.huggingface.co/production/uploads/613b0a62a14099d5afed7830/8t1zXhQfXON7boZyps3mr.png)
28
+
29
+ ## Mining Dataset Statistics
30
+
31
+ - **Number of texts used for mining**: 200,000 texts
32
+ - **Dataset**: [Lumberjackk/fineweb-2-trimming](https://huggingface.co/datasets/Lumberjackk/fineweb-2-trimming)
33
+
34
+ ## Usage
35
+
36
+ ```python
37
+ from sentence_transformers import SentenceTransformer
38
+ # Download from the 🤗 Hub
39
+ model = SentenceTransformer("lbourdois/Qwen3-Embedding-slv-32768")
40
+ # Run inference with queries and documents
41
+ query = "My query"
42
+ documents = [
43
+ "Chunk 1",
44
+ "Chunk 2",
45
+ "Chunk 3",
46
+ ]
47
+ query_embeddings = model.encode_query(query)
48
+ document_embeddings = model.encode_document(documents)
49
+ print(query_embeddings.shape, document_embeddings.shape)
50
+ # Compute similarities to determine a ranking
51
+ similarities = model.similarity(query_embeddings, document_embeddings)
52
+ print(similarities)
53
+ ```
54
+
55
+ ## Citation
56
+
57
+ #### Qwen3 Embedding
58
+
59
+ ```bibtex
60
+ @article{qwen3embedding,
61
+ title={Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Models},
62
+ author={Zhang, Yanzhao and Li, Mingxin and Long, Dingkun and Zhang, Xin and Lin, Huan and Yang, Baosong and Xie, Pengjun and Yang, An and Liu, Dayiheng and Lin, Junyang and Huang, Fei and Zhou, Jingren},
63
+ journal={arXiv preprint arXiv:2506.05176},
64
+ year={2025}
65
+ }
66
+ ```
config.json ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Qwen3ForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "eos_token_id": 32754,
8
+ "head_dim": 128,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 1024,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 3072,
13
+ "max_position_embeddings": 32768,
14
+ "max_window_layers": 28,
15
+ "model_type": "qwen3",
16
+ "num_attention_heads": 16,
17
+ "num_hidden_layers": 28,
18
+ "num_key_value_heads": 8,
19
+ "pad_token_id": 32752,
20
+ "rms_norm_eps": 1e-06,
21
+ "sliding_window": null,
22
+ "tie_word_embeddings": true,
23
+ "transformers_version": "5.0.0",
24
+ "use_cache": true,
25
+ "use_sliding_window": false,
26
+ "vocab_size": 32768,
27
+ "rope_scaling": null,
28
+ "rope_theta": 1000000,
29
+ "torch_dtype": "bfloat16"
30
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "prompts": {
3
+ "query": "Instruct: Given a web search query, retrieve relevant passages that answer the query\nQuery:",
4
+ "document": ""
5
+ },
6
+ "default_prompt_name": null,
7
+ "similarity_fn_name": "cosine"
8
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "eos_token_id": 32754,
3
+ "max_new_tokens": 2048,
4
+ "transformers_version": "4.51.3",
5
+ "pad_token_id": 32752
6
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b78b1f9716ab316ade1f2cea1c62d1f1aeb931bf13f612fd7b97dff9c39c13b7
3
+ size 948077008
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "tokenizer_class": "Qwen2Tokenizer",
3
+ "model_max_length": 131072,
4
+ "chat_template": "{%- if tools %}\n {{- '<|im_start|>system\\n' }}\n {%- if messages[0].role == 'system' %}\n {{- messages[0].content + '\\n\\n' }}\n {%- endif %}\n {{- \"# Tools\\n\\nYou may call one or more functions to assist with the user query.\\n\\nYou are provided with function signatures within <tools></tools> XML tags:\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\\n\\nFor each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\\n<tool_call>\\n{\\\"name\\\": <function-name>, \\\"arguments\\\": <args-json-object>}\\n</tool_call><|im_end|>\\n\" }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {{- '<|im_start|>system\\n' + messages[0].content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- if (message.role == \"user\") or (message.role == \"system\" and not loop.first) %}\n {{- '<|im_start|>' + message.role + '\\n' + message.content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set content = message.content %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is defined and message.reasoning_content is not none %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in message.content %}\n {%- set content = message.content.split('</think>')[-1].lstrip('\\n') %}\n {%- set reasoning_content = message.content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- if loop.index0 > ns.last_query_index %}\n {%- if loop.last or (not loop.last and reasoning_content) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content.strip('\\n') + '\\n</think>\\n\\n' + content.lstrip('\\n') }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls %}\n {%- for tool_call in message.tool_calls %}\n {%- if (loop.first and content) or (not loop.first) %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.function %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {{- '<tool_call>\\n{\"name\": \"' }}\n {{- tool_call.name }}\n {{- '\", \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.first or (messages[loop.index0 - 1].role != \"tool\") %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- message.content }}\n {{- '\\n</tool_response>' }}\n {%- if loop.last or (messages[loop.index0 + 1].role != \"tool\") %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- endif %}\n{%- endif %}",
5
+ "clean_up_tokenization_spaces": false,
6
+ "errors": "replace",
7
+ "split_special_tokens": false,
8
+ "add_bos_token": false,
9
+ "add_prefix_space": false,
10
+ "eos_token": "<|im_end|>",
11
+ "eos_token_id": 32754,
12
+ "pad_token": "<|endoftext|>",
13
+ "pad_token_id": 32752,
14
+ "bos_token": null,
15
+ "unk_token": null,
16
+ "additional_special_tokens": [
17
+ "<|endoftext|>",
18
+ "<|im_start|>",
19
+ "<|im_end|>",
20
+ "<|object_ref_start|>",
21
+ "<|object_ref_end|>",
22
+ "<|box_start|>",
23
+ "<|box_end|>",
24
+ "<|quad_start|>",
25
+ "<|quad_end|>",
26
+ "<|vision_start|>",
27
+ "<|vision_end|>",
28
+ "<|vision_pad|>",
29
+ "<|image_pad|>",
30
+ "<|video_pad|>",
31
+ "<think>",
32
+ "</think>"
33
+ ],
34
+ "added_tokens_decoder": {
35
+ "32752": {
36
+ "content": "<|endoftext|>",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ },
43
+ "32753": {
44
+ "content": "<|im_start|>",
45
+ "lstrip": false,
46
+ "normalized": false,
47
+ "rstrip": false,
48
+ "single_word": false,
49
+ "special": true
50
+ },
51
+ "32754": {
52
+ "content": "<|im_end|>",
53
+ "lstrip": false,
54
+ "normalized": false,
55
+ "rstrip": false,
56
+ "single_word": false,
57
+ "special": true
58
+ },
59
+ "32755": {
60
+ "content": "<|object_ref_start|>",
61
+ "lstrip": false,
62
+ "normalized": false,
63
+ "rstrip": false,
64
+ "single_word": false,
65
+ "special": true
66
+ },
67
+ "32756": {
68
+ "content": "<|object_ref_end|>",
69
+ "lstrip": false,
70
+ "normalized": false,
71
+ "rstrip": false,
72
+ "single_word": false,
73
+ "special": true
74
+ },
75
+ "32757": {
76
+ "content": "<|box_start|>",
77
+ "lstrip": false,
78
+ "normalized": false,
79
+ "rstrip": false,
80
+ "single_word": false,
81
+ "special": true
82
+ },
83
+ "32758": {
84
+ "content": "<|box_end|>",
85
+ "lstrip": false,
86
+ "normalized": false,
87
+ "rstrip": false,
88
+ "single_word": false,
89
+ "special": true
90
+ },
91
+ "32759": {
92
+ "content": "<|quad_start|>",
93
+ "lstrip": false,
94
+ "normalized": false,
95
+ "rstrip": false,
96
+ "single_word": false,
97
+ "special": true
98
+ },
99
+ "32760": {
100
+ "content": "<|quad_end|>",
101
+ "lstrip": false,
102
+ "normalized": false,
103
+ "rstrip": false,
104
+ "single_word": false,
105
+ "special": true
106
+ },
107
+ "32761": {
108
+ "content": "<|vision_start|>",
109
+ "lstrip": false,
110
+ "normalized": false,
111
+ "rstrip": false,
112
+ "single_word": false,
113
+ "special": true
114
+ },
115
+ "32762": {
116
+ "content": "<|vision_end|>",
117
+ "lstrip": false,
118
+ "normalized": false,
119
+ "rstrip": false,
120
+ "single_word": false,
121
+ "special": true
122
+ },
123
+ "32763": {
124
+ "content": "<|vision_pad|>",
125
+ "lstrip": false,
126
+ "normalized": false,
127
+ "rstrip": false,
128
+ "single_word": false,
129
+ "special": true
130
+ },
131
+ "32764": {
132
+ "content": "<|image_pad|>",
133
+ "lstrip": false,
134
+ "normalized": false,
135
+ "rstrip": false,
136
+ "single_word": false,
137
+ "special": true
138
+ },
139
+ "32765": {
140
+ "content": "<|video_pad|>",
141
+ "lstrip": false,
142
+ "normalized": false,
143
+ "rstrip": false,
144
+ "single_word": false,
145
+ "special": true
146
+ },
147
+ "32766": {
148
+ "content": "<think>",
149
+ "lstrip": false,
150
+ "normalized": false,
151
+ "rstrip": false,
152
+ "single_word": false,
153
+ "special": true
154
+ },
155
+ "32767": {
156
+ "content": "</think>",
157
+ "lstrip": false,
158
+ "normalized": false,
159
+ "rstrip": false,
160
+ "single_word": false,
161
+ "special": true
162
+ }
163
+ }
164
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff
 
Free AI Image Generator No sign-up. Instant results. Open Now