Sentence Similarity
sentence-transformers
Safetensors
Dutch
English
feature-extraction
retrieval
qwen3
lora
personas
belgium
Instructions to use EdwardHuy/persona-embeddings with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use EdwardHuy/persona-embeddings with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("EdwardHuy/persona-embeddings") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Upload qwen-lora-mixed-nl-seed42, qwen-lora-mixed-en-seed42
Browse files- .gitattributes +2 -0
- LICENSE-APACHE-2.0 +202 -0
- README.md +218 -218
- en/1_Pooling/config.json +10 -0
- en/chat_template.jinja +85 -0
- en/config.json +63 -0
- en/config_sentence_transformers.json +10 -0
- en/model.safetensors +3 -0
- en/modules.json +20 -0
- en/sentence_bert_config.json +4 -0
- en/tokenizer.json +3 -0
- en/tokenizer_config.json +30 -0
- nl/1_Pooling/config.json +10 -0
- nl/chat_template.jinja +85 -0
- nl/config.json +63 -0
- nl/config_sentence_transformers.json +10 -0
- nl/model.safetensors +3 -0
- nl/modules.json +20 -0
- nl/sentence_bert_config.json +4 -0
- nl/tokenizer.json +3 -0
- nl/tokenizer_config.json +30 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
en/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
nl/tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
LICENSE-APACHE-2.0
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
README.md
CHANGED
|
@@ -1,218 +1,218 @@
|
|
| 1 |
-
---
|
| 2 |
-
language:
|
| 3 |
-
- nl
|
| 4 |
-
- en
|
| 5 |
-
license: cc-by-4.0
|
| 6 |
-
library_name: sentence-transformers
|
| 7 |
-
pipeline_tag: sentence-similarity
|
| 8 |
-
base_model: Qwen/Qwen3-Embedding-0.6B
|
| 9 |
-
datasets:
|
| 10 |
-
- EdwardHuy/persona-queries
|
| 11 |
-
- nvidia/Nemotron-Personas-Belgium
|
| 12 |
-
tags:
|
| 13 |
-
- sentence-transformers
|
| 14 |
-
- feature-extraction
|
| 15 |
-
- sentence-similarity
|
| 16 |
-
- retrieval
|
| 17 |
-
- qwen3
|
| 18 |
-
- lora
|
| 19 |
-
- personas
|
| 20 |
-
- belgium
|
| 21 |
-
---
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
# Belgian Persona Embeddings (Dutch and English)
|
| 25 |
-
|
| 26 |
-
Embedding models for finding people from short descriptions, in **Dutch and
|
| 27 |
-
English**. Each is [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B)
|
| 28 |
-
fine-tuned with LoRA on synthetic "Iemand die…" / "Someone who…" queries written for the
|
| 29 |
-
[NVIDIA Nemotron-Personas-Belgium](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Belgium)
|
| 30 |
-
personas. The LoRA adapters are merged into the weights, so each folder is a
|
| 31 |
-
regular Sentence Transformers model.
|
| 32 |
-
|
| 33 |
-
The two languages were trained and evaluated **separately**, each only on its own
|
| 34 |
-
language's queries and profiles, and are stored in their own folder:
|
| 35 |
-
|
| 36 |
-
| Folder | Language | Training run | Objective | q2d MRR@10 | q2q MRR@10 |
|
| 37 |
-
|---|---|---|---|---:|---:|
|
| 38 |
-
| `nl/` | Dutch | `qwen-lora-mixed-nl-seed42` | query-to-query plus query-to-profile contrastive loss | 0.811 | 0.031 |
|
| 39 |
-
| `en/` | English | `qwen-lora-mixed-en-seed42` | query-to-query plus query-to-profile contrastive loss | 0.858 | 0.052 |
|
| 40 |
-
|
| 41 |
-
Made for the Advanced Natural Language Processing project by Ward Huybrechts and
|
| 42 |
-
Raphael Hermans.
|
| 43 |
-
|
| 44 |
-
- **Base model:** Qwen/Qwen3-Embedding-0.6B (1024 dimensions, last-token pooling, L2-normalized)
|
| 45 |
-
- **Training data:** [EdwardHuy/persona-queries](https://huggingface.co/datasets/EdwardHuy/persona-queries)
|
| 46 |
-
- **Languages:** use `nl/` for Dutch and `en/` for English. Neither was trained or
|
| 47 |
-
evaluated on the other language.
|
| 48 |
-
|
| 49 |
-
## Usage
|
| 50 |
-
|
| 51 |
-
```bash
|
| 52 |
-
pip install -U sentence-transformers
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
```python
|
| 56 |
-
from huggingface_hub import snapshot_download
|
| 57 |
-
from sentence_transformers import SentenceTransformer
|
| 58 |
-
|
| 59 |
-
language = "nl" # or "en"
|
| 60 |
-
path = snapshot_download("EdwardHuy/persona-embeddings", allow_patterns=[f"{language}/*"])
|
| 61 |
-
model = SentenceTransformer(f"{path}/{language}")
|
| 62 |
-
|
| 63 |
-
queries = ["Iemand die geniet van melancholieke romans en solitaire wandelingen in de polders."]
|
| 64 |
-
profiles = [
|
| 65 |
-
"Een gepensioneerde juriste uit Boom die graag leest en lange wandelingen maakt.",
|
| 66 |
-
"Een jonge verpleger uit Gent die in het weekend voetbalt met vrienden.",
|
| 67 |
-
]
|
| 68 |
-
|
| 69 |
-
# Query -> full profile: use the "query" prompt for queries, nothing for profiles.
|
| 70 |
-
query_embeddings = model.encode(queries, prompt_name="query")
|
| 71 |
-
profile_embeddings = model.encode(profiles)
|
| 72 |
-
print(model.similarity(query_embeddings, profile_embeddings))
|
| 73 |
-
|
| 74 |
-
# Query -> other short descriptions of the same person: same prompt on both sides.
|
| 75 |
-
a = model.encode(queries, prompt_name="same_person")
|
| 76 |
-
b = model.encode(["Iemand die rechten heeft gestudeerd en momenteel niet actief is op de arbeidsmarkt."], prompt_name="same_person")
|
| 77 |
-
print(model.similarity(a, b))
|
| 78 |
-
```
|
| 79 |
-
|
| 80 |
-
`snapshot_download` with `allow_patterns` fetches only the chosen language's folder.
|
| 81 |
-
|
| 82 |
-
The two prompts are the instructions used during training and evaluation, and are
|
| 83 |
-
the same for both languages:
|
| 84 |
-
|
| 85 |
-
| Prompt name | Used for | Text prepended to the input |
|
| 86 |
-
|---|---|---|
|
| 87 |
-
| `query` | queries searching full profiles | `Instruct: Given a short description of a person, retrieve the full profile of that person\nQuery:` |
|
| 88 |
-
| `same_person` | both sides of query-to-query search | `Instruct: Given a short description of a person's interests, work or background, retrieve other descriptions of the same person\nQuery:` |
|
| 89 |
-
|
| 90 |
-
Profiles (documents) get no prompt. Profiles up to 2304 tokens were
|
| 91 |
-
used in evaluation, which is also the models' `max_seq_length`.
|
| 92 |
-
|
| 93 |
-
### Without Sentence Transformers
|
| 94 |
-
|
| 95 |
-
```python
|
| 96 |
-
import torch
|
| 97 |
-
import torch.nn.functional as F
|
| 98 |
-
from transformers import AutoModel, AutoTokenizer
|
| 99 |
-
|
| 100 |
-
tokenizer = AutoTokenizer.from_pretrained("EdwardHuy/persona-embeddings", subfolder=language, padding_side="left")
|
| 101 |
-
model = AutoModel.from_pretrained("EdwardHuy/persona-embeddings", subfolder=language, dtype=torch.bfloat16).eval()
|
| 102 |
-
|
| 103 |
-
instruction = "Given a short description of a person, retrieve the full profile of that person"
|
| 104 |
-
texts = [f"Instruct: {instruction}\nQuery:{q}" for q in queries] + profiles
|
| 105 |
-
batch = tokenizer(texts, padding=True, truncation=True, max_length=2304, return_tensors="pt")
|
| 106 |
-
with torch.inference_mode():
|
| 107 |
-
hidden = model(**batch).last_hidden_state
|
| 108 |
-
embeddings = F.normalize(hidden[:, -1].float(), dim=-1) # left padding: last position = last token
|
| 109 |
-
```
|
| 110 |
-
|
| 111 |
-
### Tokenizer note
|
| 112 |
-
|
| 113 |
-
During training the inputs ended in `<|endoftext|><|im_end|>`: the Qwen3-Embedding
|
| 114 |
-
tokenizer appends `<|endoftext|>` itself, and the training code appended the
|
| 115 |
-
`<|im_end|>` end-of-sequence token after it. The embedding is the hidden state of
|
| 116 |
-
that final token. The tokenizers in this repository append both tokens, so the
|
| 117 |
-
usage above reproduces the training setup. If you combine these weights with the
|
| 118 |
-
original Qwen3-Embedding tokenizer instead, the embeddings will not match.
|
| 119 |
-
|
| 120 |
-
## Training
|
| 121 |
-
|
| 122 |
-
- **Data:** each person has three short queries and a full persona profile, per
|
| 123 |
-
language. Persons are split by a hash of their UUID, and the split is the same for
|
| 124 |
-
Dutch and English, so no person or translation of a person crosses splits. The
|
| 125 |
-
split is computed by `src/embeddings.py:split_assignment` in the project
|
| 126 |
-
repository; the published dataset contains all splits.
|
| 127 |
-
- **Objective:** The sum of two InfoNCE losses. (1) Symmetric query-to-query: the positive for a query is another query of the same person. (2) Query-to-profile: the positive is the person's full profile, and the other persons' profiles in the batch are negatives. Profiles are encoded with gradient caching so a full batch fits in 10 GB.
|
| 128 |
-
- **Batches:** distinct persons only, so every in-batch negative is a different
|
| 129 |
-
person. Each person contributes the same number of pairs per epoch.
|
| 130 |
-
- **Model selection:** validation MRR@10 after every epoch (mean of query-to-query and query-to-profile MRR@10).
|
| 131 |
-
|
| 132 |
-
| | Dutch (`nl/`) | English (`en/`) |
|
| 133 |
-
|---|---|---|
|
| 134 |
-
| Training run | `qwen-lora-mixed-nl-seed42` | `qwen-lora-mixed-en-seed42` |
|
| 135 |
-
| Train / validation / test persons | 2,788 / 180 / 366 | 2,776 / 188 / 370 |
|
| 136 |
-
| Queries per person | 3 | 3 |
|
| 137 |
-
| Epochs (best epoch) | 1 (1) | 1 (1) |
|
| 138 |
-
| Persons per batch | 128 | 128 |
|
| 139 |
-
| LoRA rank / alpha / dropout | 16 / 32 / 0.0 | 16 / 32 / 0.0 |
|
| 140 |
-
| Learning rate | 0.0001 | 0.0001 |
|
| 141 |
-
| Temperature | 0.05 | 0.05 |
|
| 142 |
-
| Max query / profile length (tokens) | 128 / 2304 | 128 / 2304 |
|
| 143 |
-
| Seed | 42 | 42 |
|
| 144 |
-
| Training time | about 111 minutes | about 64 minutes |
|
| 145 |
-
|
| 146 |
-
Both runs used LoRA on the q, k, v, o, gate, up and down projections, a linear
|
| 147 |
-
learning-rate schedule with 10% warmup, AdamW with weight decay 0.01, a bf16 frozen
|
| 148 |
-
base with fp32 LoRA weights, and one NVIDIA RTX 3080 (10 GB).
|
| 149 |
-
|
| 150 |
-
## Evaluation
|
| 151 |
-
|
| 152 |
-
Held-out test persons, each language evaluated on its own queries and profiles.
|
| 153 |
-
Each test query is used once:
|
| 154 |
-
|
| 155 |
-
- **q2d:** the query searches all test profiles; only its own person's profile is relevant.
|
| 156 |
-
- **q2q:** the query searches all other test queries; the person's other two queries are relevant.
|
| 157 |
-
|
| 158 |
-
Brackets are 95% person-level bootstrap intervals from a single run.
|
| 159 |
-
|
| 160 |
-
| Language | Model | q2d MRR@10 | q2d Acc@1 | q2d Recall@10 | q2q MRR@10 | q2q Acc@1 | q2q Recall@10 |
|
| 161 |
-
|---|---|---:|---:|---:|---:|---:|---:|
|
| 162 |
-
| Dutch | e5-nl | 0.128 [0.110, 0.146] | 0.069 [0.053, 0.087] | 0.283 [0.253, 0.313] | 0.006 [0.003, 0.009] | 0.001 [0.000, 0.003] | 0.015 [0.009, 0.020] |
|
| 163 |
-
| Dutch | qwen-base | 0.135 [0.116, 0.153] | 0.077 [0.059, 0.095] | 0.288 [0.258, 0.320] | 0.007 [0.004, 0.011] | 0.003 [0.000, 0.006] | 0.012 [0.007, 0.018] |
|
| 164 |
-
| Dutch | **this model** (`nl/`) | 0.811 [0.793, 0.830] | 0.741 [0.717, 0.766] | 0.943 [0.929, 0.955] | 0.031 [0.021, 0.042] | 0.013 [0.005, 0.022] | 0.052 [0.041, 0.065] |
|
| 165 |
-
| English | e5-nl | 0.125 [0.108, 0.143] | 0.068 [0.053, 0.084] | 0.272 [0.244, 0.302] | 0.012 [0.006, 0.019] | 0.005 [0.001, 0.011] | 0.016 [0.010, 0.023] |
|
| 166 |
-
| English | qwen-base | 0.232 [0.210, 0.254] | 0.165 [0.142, 0.187] | 0.419 [0.390, 0.450] | 0.011 [0.006, 0.017] | 0.004 [0.000, 0.008] | 0.018 [0.012, 0.025] |
|
| 167 |
-
| English | **this model** (`en/`) | 0.858 [0.841, 0.876] | 0.799 [0.774, 0.825] | 0.966 [0.955, 0.976] | 0.052 [0.039, 0.067] | 0.023 [0.013, 0.034] | 0.078 [0.064, 0.095] |
|
| 168 |
-
|
| 169 |
-
`e5-nl` is [clips/e5-large-trm-nl](https://huggingface.co/clips/e5-large-trm-nl) and
|
| 170 |
-
`qwen-base` is the unmodified base model, both evaluated with the same code and data.
|
| 171 |
-
|
| 172 |
-
Read these numbers with care:
|
| 173 |
-
|
| 174 |
-
- The test pools are small (a few hundred profiles), so the task is easier than
|
| 175 |
-
searching a large collection.
|
| 176 |
-
- The test persons were carved out of the generated training queries by hash, not
|
| 177 |
-
taken from the project's separate validation/test manifest.
|
| 178 |
-
- A person's three queries are written from different profile fields, which limits
|
| 179 |
-
how similar they can be. This caps the q2q scores.
|
| 180 |
-
- The queries are synthetic and have not been fully reviewed by humans. Other
|
| 181 |
-
persons that also fit a query are counted as wrong.
|
| 182 |
-
- Dutch and English scores come from separate models and separately generated
|
| 183 |
-
queries. They are not a controlled comparison between the languages.
|
| 184 |
-
|
| 185 |
-
## Intended use and limitations
|
| 186 |
-
|
| 187 |
-
Intended for research on persona retrieval and as a starting point for retrieving
|
| 188 |
-
Belgian persona profiles from short Dutch or English descriptions. It is not meant
|
| 189 |
-
for searching or profiling real people.
|
| 190 |
-
|
| 191 |
-
- All training data is synthetic. The personas may carry stereotypes or internal
|
| 192 |
-
inconsistencies, and the generated queries can inherit them or add their own errors.
|
| 193 |
-
- The models were only trained on "Iemand die…" / "Someone who…" descriptions and
|
| 194 |
-
Nemotron-style profiles. Behaviour on other query styles, other domains or mixed
|
| 195 |
-
languages was not measured.
|
| 196 |
-
- Fine-tuning on this narrow task may reduce quality on general retrieval tasks
|
| 197 |
-
compared with the base model. This was not measured.
|
| 198 |
-
|
| 199 |
-
## License and attribution
|
| 200 |
-
|
| 201 |
-
Our fine-tuning changes and this model card are released under
|
| 202 |
-
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), the same license as the
|
| 203 |
-
training data. The weights are a modified version of
|
| 204 |
-
[Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B), which is
|
| 205 |
-
licensed under the Apache License 2.0; the parts that come from the base model stay
|
| 206 |
-
under Apache 2.0, and a copy of that license is included as `LICENSE-APACHE-2.0`.
|
| 207 |
-
The training data is derived from
|
| 208 |
-
[NVIDIA Nemotron-Personas-Belgium](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Belgium)
|
| 209 |
-
(CC BY 4.0); keep NVIDIA's and Qwen's attribution when you redistribute this model.
|
| 210 |
-
|
| 211 |
-
```bibtex
|
| 212 |
-
@misc{belgian_persona_embeddings,
|
| 213 |
-
title = {Belgian Persona Embeddings},
|
| 214 |
-
author = {Huybrechts, Ward and Hermans, Raphael},
|
| 215 |
-
year = {2026},
|
| 216 |
-
url = {https://huggingface.co/EdwardHuy/persona-embeddings}
|
| 217 |
-
}
|
| 218 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- nl
|
| 4 |
+
- en
|
| 5 |
+
license: cc-by-4.0
|
| 6 |
+
library_name: sentence-transformers
|
| 7 |
+
pipeline_tag: sentence-similarity
|
| 8 |
+
base_model: Qwen/Qwen3-Embedding-0.6B
|
| 9 |
+
datasets:
|
| 10 |
+
- EdwardHuy/persona-queries
|
| 11 |
+
- nvidia/Nemotron-Personas-Belgium
|
| 12 |
+
tags:
|
| 13 |
+
- sentence-transformers
|
| 14 |
+
- feature-extraction
|
| 15 |
+
- sentence-similarity
|
| 16 |
+
- retrieval
|
| 17 |
+
- qwen3
|
| 18 |
+
- lora
|
| 19 |
+
- personas
|
| 20 |
+
- belgium
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
# Belgian Persona Embeddings (Dutch and English)
|
| 25 |
+
|
| 26 |
+
Embedding models for finding people from short descriptions, in **Dutch and
|
| 27 |
+
English**. Each is [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B)
|
| 28 |
+
fine-tuned with LoRA on synthetic "Iemand die…" / "Someone who…" queries written for the
|
| 29 |
+
[NVIDIA Nemotron-Personas-Belgium](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Belgium)
|
| 30 |
+
personas. The LoRA adapters are merged into the weights, so each folder is a
|
| 31 |
+
regular Sentence Transformers model.
|
| 32 |
+
|
| 33 |
+
The two languages were trained and evaluated **separately**, each only on its own
|
| 34 |
+
language's queries and profiles, and are stored in their own folder:
|
| 35 |
+
|
| 36 |
+
| Folder | Language | Training run | Objective | q2d MRR@10 | q2q MRR@10 |
|
| 37 |
+
|---|---|---|---|---:|---:|
|
| 38 |
+
| `nl/` | Dutch | `qwen-lora-mixed-nl-seed42` | query-to-query plus query-to-profile contrastive loss | 0.811 | 0.031 |
|
| 39 |
+
| `en/` | English | `qwen-lora-mixed-en-seed42` | query-to-query plus query-to-profile contrastive loss | 0.858 | 0.052 |
|
| 40 |
+
|
| 41 |
+
Made for the Advanced Natural Language Processing project by Ward Huybrechts and
|
| 42 |
+
Raphael Hermans.
|
| 43 |
+
|
| 44 |
+
- **Base model:** Qwen/Qwen3-Embedding-0.6B (1024 dimensions, last-token pooling, L2-normalized)
|
| 45 |
+
- **Training data:** [EdwardHuy/persona-queries](https://huggingface.co/datasets/EdwardHuy/persona-queries)
|
| 46 |
+
- **Languages:** use `nl/` for Dutch and `en/` for English. Neither was trained or
|
| 47 |
+
evaluated on the other language.
|
| 48 |
+
|
| 49 |
+
## Usage
|
| 50 |
+
|
| 51 |
+
```bash
|
| 52 |
+
pip install -U sentence-transformers
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
from huggingface_hub import snapshot_download
|
| 57 |
+
from sentence_transformers import SentenceTransformer
|
| 58 |
+
|
| 59 |
+
language = "nl" # or "en"
|
| 60 |
+
path = snapshot_download("EdwardHuy/persona-embeddings", allow_patterns=[f"{language}/*"])
|
| 61 |
+
model = SentenceTransformer(f"{path}/{language}")
|
| 62 |
+
|
| 63 |
+
queries = ["Iemand die geniet van melancholieke romans en solitaire wandelingen in de polders."]
|
| 64 |
+
profiles = [
|
| 65 |
+
"Een gepensioneerde juriste uit Boom die graag leest en lange wandelingen maakt.",
|
| 66 |
+
"Een jonge verpleger uit Gent die in het weekend voetbalt met vrienden.",
|
| 67 |
+
]
|
| 68 |
+
|
| 69 |
+
# Query -> full profile: use the "query" prompt for queries, nothing for profiles.
|
| 70 |
+
query_embeddings = model.encode(queries, prompt_name="query")
|
| 71 |
+
profile_embeddings = model.encode(profiles)
|
| 72 |
+
print(model.similarity(query_embeddings, profile_embeddings))
|
| 73 |
+
|
| 74 |
+
# Query -> other short descriptions of the same person: same prompt on both sides.
|
| 75 |
+
a = model.encode(queries, prompt_name="same_person")
|
| 76 |
+
b = model.encode(["Iemand die rechten heeft gestudeerd en momenteel niet actief is op de arbeidsmarkt."], prompt_name="same_person")
|
| 77 |
+
print(model.similarity(a, b))
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
`snapshot_download` with `allow_patterns` fetches only the chosen language's folder.
|
| 81 |
+
|
| 82 |
+
The two prompts are the instructions used during training and evaluation, and are
|
| 83 |
+
the same for both languages:
|
| 84 |
+
|
| 85 |
+
| Prompt name | Used for | Text prepended to the input |
|
| 86 |
+
|---|---|---|
|
| 87 |
+
| `query` | queries searching full profiles | `Instruct: Given a short description of a person, retrieve the full profile of that person\nQuery:` |
|
| 88 |
+
| `same_person` | both sides of query-to-query search | `Instruct: Given a short description of a person's interests, work or background, retrieve other descriptions of the same person\nQuery:` |
|
| 89 |
+
|
| 90 |
+
Profiles (documents) get no prompt. Profiles up to 2304 tokens were
|
| 91 |
+
used in evaluation, which is also the models' `max_seq_length`.
|
| 92 |
+
|
| 93 |
+
### Without Sentence Transformers
|
| 94 |
+
|
| 95 |
+
```python
|
| 96 |
+
import torch
|
| 97 |
+
import torch.nn.functional as F
|
| 98 |
+
from transformers import AutoModel, AutoTokenizer
|
| 99 |
+
|
| 100 |
+
tokenizer = AutoTokenizer.from_pretrained("EdwardHuy/persona-embeddings", subfolder=language, padding_side="left")
|
| 101 |
+
model = AutoModel.from_pretrained("EdwardHuy/persona-embeddings", subfolder=language, dtype=torch.bfloat16).eval()
|
| 102 |
+
|
| 103 |
+
instruction = "Given a short description of a person, retrieve the full profile of that person"
|
| 104 |
+
texts = [f"Instruct: {instruction}\nQuery:{q}" for q in queries] + profiles
|
| 105 |
+
batch = tokenizer(texts, padding=True, truncation=True, max_length=2304, return_tensors="pt")
|
| 106 |
+
with torch.inference_mode():
|
| 107 |
+
hidden = model(**batch).last_hidden_state
|
| 108 |
+
embeddings = F.normalize(hidden[:, -1].float(), dim=-1) # left padding: last position = last token
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
### Tokenizer note
|
| 112 |
+
|
| 113 |
+
During training the inputs ended in `<|endoftext|><|im_end|>`: the Qwen3-Embedding
|
| 114 |
+
tokenizer appends `<|endoftext|>` itself, and the training code appended the
|
| 115 |
+
`<|im_end|>` end-of-sequence token after it. The embedding is the hidden state of
|
| 116 |
+
that final token. The tokenizers in this repository append both tokens, so the
|
| 117 |
+
usage above reproduces the training setup. If you combine these weights with the
|
| 118 |
+
original Qwen3-Embedding tokenizer instead, the embeddings will not match.
|
| 119 |
+
|
| 120 |
+
## Training
|
| 121 |
+
|
| 122 |
+
- **Data:** each person has three short queries and a full persona profile, per
|
| 123 |
+
language. Persons are split by a hash of their UUID, and the split is the same for
|
| 124 |
+
Dutch and English, so no person or translation of a person crosses splits. The
|
| 125 |
+
split is computed by `src/embeddings.py:split_assignment` in the project
|
| 126 |
+
repository; the published dataset contains all splits.
|
| 127 |
+
- **Objective:** The sum of two InfoNCE losses. (1) Symmetric query-to-query: the positive for a query is another query of the same person. (2) Query-to-profile: the positive is the person's full profile, and the other persons' profiles in the batch are negatives. Profiles are encoded with gradient caching so a full batch fits in 10 GB.
|
| 128 |
+
- **Batches:** distinct persons only, so every in-batch negative is a different
|
| 129 |
+
person. Each person contributes the same number of pairs per epoch.
|
| 130 |
+
- **Model selection:** validation MRR@10 after every epoch (mean of query-to-query and query-to-profile MRR@10).
|
| 131 |
+
|
| 132 |
+
| | Dutch (`nl/`) | English (`en/`) |
|
| 133 |
+
|---|---|---|
|
| 134 |
+
| Training run | `qwen-lora-mixed-nl-seed42` | `qwen-lora-mixed-en-seed42` |
|
| 135 |
+
| Train / validation / test persons | 2,788 / 180 / 366 | 2,776 / 188 / 370 |
|
| 136 |
+
| Queries per person | 3 | 3 |
|
| 137 |
+
| Epochs (best epoch) | 1 (1) | 1 (1) |
|
| 138 |
+
| Persons per batch | 128 | 128 |
|
| 139 |
+
| LoRA rank / alpha / dropout | 16 / 32 / 0.0 | 16 / 32 / 0.0 |
|
| 140 |
+
| Learning rate | 0.0001 | 0.0001 |
|
| 141 |
+
| Temperature | 0.05 | 0.05 |
|
| 142 |
+
| Max query / profile length (tokens) | 128 / 2304 | 128 / 2304 |
|
| 143 |
+
| Seed | 42 | 42 |
|
| 144 |
+
| Training time | about 111 minutes | about 64 minutes |
|
| 145 |
+
|
| 146 |
+
Both runs used LoRA on the q, k, v, o, gate, up and down projections, a linear
|
| 147 |
+
learning-rate schedule with 10% warmup, AdamW with weight decay 0.01, a bf16 frozen
|
| 148 |
+
base with fp32 LoRA weights, and one NVIDIA RTX 3080 (10 GB).
|
| 149 |
+
|
| 150 |
+
## Evaluation
|
| 151 |
+
|
| 152 |
+
Held-out test persons, each language evaluated on its own queries and profiles.
|
| 153 |
+
Each test query is used once:
|
| 154 |
+
|
| 155 |
+
- **q2d:** the query searches all test profiles; only its own person's profile is relevant.
|
| 156 |
+
- **q2q:** the query searches all other test queries; the person's other two queries are relevant.
|
| 157 |
+
|
| 158 |
+
Brackets are 95% person-level bootstrap intervals from a single run.
|
| 159 |
+
|
| 160 |
+
| Language | Model | q2d MRR@10 | q2d Acc@1 | q2d Recall@10 | q2q MRR@10 | q2q Acc@1 | q2q Recall@10 |
|
| 161 |
+
|---|---|---:|---:|---:|---:|---:|---:|
|
| 162 |
+
| Dutch | e5-nl | 0.128 [0.110, 0.146] | 0.069 [0.053, 0.087] | 0.283 [0.253, 0.313] | 0.006 [0.003, 0.009] | 0.001 [0.000, 0.003] | 0.015 [0.009, 0.020] |
|
| 163 |
+
| Dutch | qwen-base | 0.135 [0.116, 0.153] | 0.077 [0.059, 0.095] | 0.288 [0.258, 0.320] | 0.007 [0.004, 0.011] | 0.003 [0.000, 0.006] | 0.012 [0.007, 0.018] |
|
| 164 |
+
| Dutch | **this model** (`nl/`) | 0.811 [0.793, 0.830] | 0.741 [0.717, 0.766] | 0.943 [0.929, 0.955] | 0.031 [0.021, 0.042] | 0.013 [0.005, 0.022] | 0.052 [0.041, 0.065] |
|
| 165 |
+
| English | e5-nl | 0.125 [0.108, 0.143] | 0.068 [0.053, 0.084] | 0.272 [0.244, 0.302] | 0.012 [0.006, 0.019] | 0.005 [0.001, 0.011] | 0.016 [0.010, 0.023] |
|
| 166 |
+
| English | qwen-base | 0.232 [0.210, 0.254] | 0.165 [0.142, 0.187] | 0.419 [0.390, 0.450] | 0.011 [0.006, 0.017] | 0.004 [0.000, 0.008] | 0.018 [0.012, 0.025] |
|
| 167 |
+
| English | **this model** (`en/`) | 0.858 [0.841, 0.876] | 0.799 [0.774, 0.825] | 0.966 [0.955, 0.976] | 0.052 [0.039, 0.067] | 0.023 [0.013, 0.034] | 0.078 [0.064, 0.095] |
|
| 168 |
+
|
| 169 |
+
`e5-nl` is [clips/e5-large-trm-nl](https://huggingface.co/clips/e5-large-trm-nl) and
|
| 170 |
+
`qwen-base` is the unmodified base model, both evaluated with the same code and data.
|
| 171 |
+
|
| 172 |
+
Read these numbers with care:
|
| 173 |
+
|
| 174 |
+
- The test pools are small (a few hundred profiles), so the task is easier than
|
| 175 |
+
searching a large collection.
|
| 176 |
+
- The test persons were carved out of the generated training queries by hash, not
|
| 177 |
+
taken from the project's separate validation/test manifest.
|
| 178 |
+
- A person's three queries are written from different profile fields, which limits
|
| 179 |
+
how similar they can be. This caps the q2q scores.
|
| 180 |
+
- The queries are synthetic and have not been fully reviewed by humans. Other
|
| 181 |
+
persons that also fit a query are counted as wrong.
|
| 182 |
+
- Dutch and English scores come from separate models and separately generated
|
| 183 |
+
queries. They are not a controlled comparison between the languages.
|
| 184 |
+
|
| 185 |
+
## Intended use and limitations
|
| 186 |
+
|
| 187 |
+
Intended for research on persona retrieval and as a starting point for retrieving
|
| 188 |
+
Belgian persona profiles from short Dutch or English descriptions. It is not meant
|
| 189 |
+
for searching or profiling real people.
|
| 190 |
+
|
| 191 |
+
- All training data is synthetic. The personas may carry stereotypes or internal
|
| 192 |
+
inconsistencies, and the generated queries can inherit them or add their own errors.
|
| 193 |
+
- The models were only trained on "Iemand die…" / "Someone who…" descriptions and
|
| 194 |
+
Nemotron-style profiles. Behaviour on other query styles, other domains or mixed
|
| 195 |
+
languages was not measured.
|
| 196 |
+
- Fine-tuning on this narrow task may reduce quality on general retrieval tasks
|
| 197 |
+
compared with the base model. This was not measured.
|
| 198 |
+
|
| 199 |
+
## License and attribution
|
| 200 |
+
|
| 201 |
+
Our fine-tuning changes and this model card are released under
|
| 202 |
+
[CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), the same license as the
|
| 203 |
+
training data. The weights are a modified version of
|
| 204 |
+
[Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B), which is
|
| 205 |
+
licensed under the Apache License 2.0; the parts that come from the base model stay
|
| 206 |
+
under Apache 2.0, and a copy of that license is included as `LICENSE-APACHE-2.0`.
|
| 207 |
+
The training data is derived from
|
| 208 |
+
[NVIDIA Nemotron-Personas-Belgium](https://huggingface.co/datasets/nvidia/Nemotron-Personas-Belgium)
|
| 209 |
+
(CC BY 4.0); keep NVIDIA's and Qwen's attribution when you redistribute this model.
|
| 210 |
+
|
| 211 |
+
```bibtex
|
| 212 |
+
@misc{belgian_persona_embeddings,
|
| 213 |
+
title = {Belgian Persona Embeddings},
|
| 214 |
+
author = {Huybrechts, Ward and Hermans, Raphael},
|
| 215 |
+
year = {2026},
|
| 216 |
+
url = {https://huggingface.co/EdwardHuy/persona-embeddings}
|
| 217 |
+
}
|
| 218 |
+
```
|
en/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 |
+
}
|
en/chat_template.jinja
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# 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>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\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" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
+
{%- for message in messages %}
|
| 26 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 27 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 28 |
+
{%- elif message.role == "assistant" %}
|
| 29 |
+
{%- set content = message.content %}
|
| 30 |
+
{%- set reasoning_content = '' %}
|
| 31 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 32 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 33 |
+
{%- else %}
|
| 34 |
+
{%- if '</think>' in message.content %}
|
| 35 |
+
{%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
|
| 36 |
+
{%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 37 |
+
{%- endif %}
|
| 38 |
+
{%- endif %}
|
| 39 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 40 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 41 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 42 |
+
{%- else %}
|
| 43 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- else %}
|
| 46 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- if message.tool_calls %}
|
| 49 |
+
{%- for tool_call in message.tool_calls %}
|
| 50 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 51 |
+
{{- '\n' }}
|
| 52 |
+
{%- endif %}
|
| 53 |
+
{%- if tool_call.function %}
|
| 54 |
+
{%- set tool_call = tool_call.function %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 57 |
+
{{- tool_call.name }}
|
| 58 |
+
{{- '", "arguments": ' }}
|
| 59 |
+
{%- if tool_call.arguments is string %}
|
| 60 |
+
{{- tool_call.arguments }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{{- tool_call.arguments | tojson }}
|
| 63 |
+
{%- endif %}
|
| 64 |
+
{{- '}\n</tool_call>' }}
|
| 65 |
+
{%- endfor %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{{- '<|im_end|>\n' }}
|
| 68 |
+
{%- elif message.role == "tool" %}
|
| 69 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 70 |
+
{{- '<|im_start|>user' }}
|
| 71 |
+
{%- endif %}
|
| 72 |
+
{{- '\n<tool_response>\n' }}
|
| 73 |
+
{{- message.content }}
|
| 74 |
+
{{- '\n</tool_response>' }}
|
| 75 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 76 |
+
{{- '<|im_end|>\n' }}
|
| 77 |
+
{%- endif %}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
{%- endfor %}
|
| 80 |
+
{%- if add_generation_prompt %}
|
| 81 |
+
{{- '<|im_start|>assistant\n' }}
|
| 82 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 83 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
{%- endif %}
|
en/config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3Model"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 151643,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 151643,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 1024,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 3072,
|
| 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 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention"
|
| 44 |
+
],
|
| 45 |
+
"max_position_embeddings": 32768,
|
| 46 |
+
"max_window_layers": 28,
|
| 47 |
+
"model_type": "qwen3",
|
| 48 |
+
"num_attention_heads": 16,
|
| 49 |
+
"num_hidden_layers": 28,
|
| 50 |
+
"num_key_value_heads": 8,
|
| 51 |
+
"pad_token_id": null,
|
| 52 |
+
"rms_norm_eps": 1e-06,
|
| 53 |
+
"rope_parameters": {
|
| 54 |
+
"rope_theta": 1000000,
|
| 55 |
+
"rope_type": "default"
|
| 56 |
+
},
|
| 57 |
+
"sliding_window": null,
|
| 58 |
+
"tie_word_embeddings": true,
|
| 59 |
+
"transformers_version": "5.22.2",
|
| 60 |
+
"use_cache": true,
|
| 61 |
+
"use_sliding_window": false,
|
| 62 |
+
"vocab_size": 151669
|
| 63 |
+
}
|
en/config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"prompts": {
|
| 3 |
+
"query": "Instruct: Given a short description of a person, retrieve the full profile of that person\nQuery:",
|
| 4 |
+
"same_person": "Instruct: Given a short description of a person's interests, work or background, retrieve other descriptions of the same person\nQuery:",
|
| 5 |
+
"document": ""
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"similarity_fn_name": "cosine",
|
| 9 |
+
"model_type": "SentenceTransformer"
|
| 10 |
+
}
|
en/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f442127e28b707695b2147a19b58feff99b8a54d68275024f4e603f011474d3e
|
| 3 |
+
size 1191586416
|
en/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 |
+
]
|
en/sentence_bert_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_seq_length": 2304,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
en/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:398e864f177c0c4fabfbdf57672a4047ae645cf21ca0b5d740f46789efe8fc8f
|
| 3 |
+
size 12181707
|
en/tokenizer_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"is_local": false,
|
| 24 |
+
"local_files_only": false,
|
| 25 |
+
"model_max_length": 131072,
|
| 26 |
+
"pad_token": "<|endoftext|>",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null
|
| 30 |
+
}
|
nl/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 |
+
}
|
nl/chat_template.jinja
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{%- if tools %}
|
| 2 |
+
{{- '<|im_start|>system\n' }}
|
| 3 |
+
{%- if messages[0].role == 'system' %}
|
| 4 |
+
{{- messages[0].content + '\n\n' }}
|
| 5 |
+
{%- endif %}
|
| 6 |
+
{{- "# 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>" }}
|
| 7 |
+
{%- for tool in tools %}
|
| 8 |
+
{{- "\n" }}
|
| 9 |
+
{{- tool | tojson }}
|
| 10 |
+
{%- endfor %}
|
| 11 |
+
{{- "\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" }}
|
| 12 |
+
{%- else %}
|
| 13 |
+
{%- if messages[0].role == 'system' %}
|
| 14 |
+
{{- '<|im_start|>system\n' + messages[0].content + '<|im_end|>\n' }}
|
| 15 |
+
{%- endif %}
|
| 16 |
+
{%- endif %}
|
| 17 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 18 |
+
{%- for message in messages[::-1] %}
|
| 19 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 20 |
+
{%- if ns.multi_step_tool and message.role == "user" and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 21 |
+
{%- set ns.multi_step_tool = false %}
|
| 22 |
+
{%- set ns.last_query_index = index %}
|
| 23 |
+
{%- endif %}
|
| 24 |
+
{%- endfor %}
|
| 25 |
+
{%- for message in messages %}
|
| 26 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 27 |
+
{{- '<|im_start|>' + message.role + '\n' + message.content + '<|im_end|>' + '\n' }}
|
| 28 |
+
{%- elif message.role == "assistant" %}
|
| 29 |
+
{%- set content = message.content %}
|
| 30 |
+
{%- set reasoning_content = '' %}
|
| 31 |
+
{%- if message.reasoning_content is defined and message.reasoning_content is not none %}
|
| 32 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 33 |
+
{%- else %}
|
| 34 |
+
{%- if '</think>' in message.content %}
|
| 35 |
+
{%- set content = message.content.split('</think>')[-1].lstrip('\n') %}
|
| 36 |
+
{%- set reasoning_content = message.content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 37 |
+
{%- endif %}
|
| 38 |
+
{%- endif %}
|
| 39 |
+
{%- if loop.index0 > ns.last_query_index %}
|
| 40 |
+
{%- if loop.last or (not loop.last and reasoning_content) %}
|
| 41 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 42 |
+
{%- else %}
|
| 43 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 44 |
+
{%- endif %}
|
| 45 |
+
{%- else %}
|
| 46 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 47 |
+
{%- endif %}
|
| 48 |
+
{%- if message.tool_calls %}
|
| 49 |
+
{%- for tool_call in message.tool_calls %}
|
| 50 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 51 |
+
{{- '\n' }}
|
| 52 |
+
{%- endif %}
|
| 53 |
+
{%- if tool_call.function %}
|
| 54 |
+
{%- set tool_call = tool_call.function %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{{- '<tool_call>\n{"name": "' }}
|
| 57 |
+
{{- tool_call.name }}
|
| 58 |
+
{{- '", "arguments": ' }}
|
| 59 |
+
{%- if tool_call.arguments is string %}
|
| 60 |
+
{{- tool_call.arguments }}
|
| 61 |
+
{%- else %}
|
| 62 |
+
{{- tool_call.arguments | tojson }}
|
| 63 |
+
{%- endif %}
|
| 64 |
+
{{- '}\n</tool_call>' }}
|
| 65 |
+
{%- endfor %}
|
| 66 |
+
{%- endif %}
|
| 67 |
+
{{- '<|im_end|>\n' }}
|
| 68 |
+
{%- elif message.role == "tool" %}
|
| 69 |
+
{%- if loop.first or (messages[loop.index0 - 1].role != "tool") %}
|
| 70 |
+
{{- '<|im_start|>user' }}
|
| 71 |
+
{%- endif %}
|
| 72 |
+
{{- '\n<tool_response>\n' }}
|
| 73 |
+
{{- message.content }}
|
| 74 |
+
{{- '\n</tool_response>' }}
|
| 75 |
+
{%- if loop.last or (messages[loop.index0 + 1].role != "tool") %}
|
| 76 |
+
{{- '<|im_end|>\n' }}
|
| 77 |
+
{%- endif %}
|
| 78 |
+
{%- endif %}
|
| 79 |
+
{%- endfor %}
|
| 80 |
+
{%- if add_generation_prompt %}
|
| 81 |
+
{{- '<|im_start|>assistant\n' }}
|
| 82 |
+
{%- if enable_thinking is defined and enable_thinking is false %}
|
| 83 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 84 |
+
{%- endif %}
|
| 85 |
+
{%- endif %}
|
nl/config.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen3Model"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 151643,
|
| 8 |
+
"dtype": "bfloat16",
|
| 9 |
+
"eos_token_id": 151643,
|
| 10 |
+
"head_dim": 128,
|
| 11 |
+
"hidden_act": "silu",
|
| 12 |
+
"hidden_size": 1024,
|
| 13 |
+
"initializer_range": 0.02,
|
| 14 |
+
"intermediate_size": 3072,
|
| 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 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention"
|
| 44 |
+
],
|
| 45 |
+
"max_position_embeddings": 32768,
|
| 46 |
+
"max_window_layers": 28,
|
| 47 |
+
"model_type": "qwen3",
|
| 48 |
+
"num_attention_heads": 16,
|
| 49 |
+
"num_hidden_layers": 28,
|
| 50 |
+
"num_key_value_heads": 8,
|
| 51 |
+
"pad_token_id": null,
|
| 52 |
+
"rms_norm_eps": 1e-06,
|
| 53 |
+
"rope_parameters": {
|
| 54 |
+
"rope_theta": 1000000,
|
| 55 |
+
"rope_type": "default"
|
| 56 |
+
},
|
| 57 |
+
"sliding_window": null,
|
| 58 |
+
"tie_word_embeddings": true,
|
| 59 |
+
"transformers_version": "5.22.2",
|
| 60 |
+
"use_cache": true,
|
| 61 |
+
"use_sliding_window": false,
|
| 62 |
+
"vocab_size": 151669
|
| 63 |
+
}
|
nl/config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"prompts": {
|
| 3 |
+
"query": "Instruct: Given a short description of a person, retrieve the full profile of that person\nQuery:",
|
| 4 |
+
"same_person": "Instruct: Given a short description of a person's interests, work or background, retrieve other descriptions of the same person\nQuery:",
|
| 5 |
+
"document": ""
|
| 6 |
+
},
|
| 7 |
+
"default_prompt_name": null,
|
| 8 |
+
"similarity_fn_name": "cosine",
|
| 9 |
+
"model_type": "SentenceTransformer"
|
| 10 |
+
}
|
nl/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9dacf7cd587415f01498a01c87991b1dcff46f8ce9ad36371ee6c6dab6da99a7
|
| 3 |
+
size 1191586416
|
nl/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 |
+
]
|
nl/sentence_bert_config.json
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"max_seq_length": 2304,
|
| 3 |
+
"do_lower_case": false
|
| 4 |
+
}
|
nl/tokenizer.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:398e864f177c0c4fabfbdf57672a4047ae645cf21ca0b5d740f46789efe8fc8f
|
| 3 |
+
size 12181707
|
nl/tokenizer_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": null,
|
| 5 |
+
"clean_up_tokenization_spaces": false,
|
| 6 |
+
"eos_token": "<|im_end|>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"extra_special_tokens": [
|
| 9 |
+
"<|im_start|>",
|
| 10 |
+
"<|im_end|>",
|
| 11 |
+
"<|object_ref_start|>",
|
| 12 |
+
"<|object_ref_end|>",
|
| 13 |
+
"<|box_start|>",
|
| 14 |
+
"<|box_end|>",
|
| 15 |
+
"<|quad_start|>",
|
| 16 |
+
"<|quad_end|>",
|
| 17 |
+
"<|vision_start|>",
|
| 18 |
+
"<|vision_end|>",
|
| 19 |
+
"<|vision_pad|>",
|
| 20 |
+
"<|image_pad|>",
|
| 21 |
+
"<|video_pad|>"
|
| 22 |
+
],
|
| 23 |
+
"is_local": false,
|
| 24 |
+
"local_files_only": false,
|
| 25 |
+
"model_max_length": 131072,
|
| 26 |
+
"pad_token": "<|endoftext|>",
|
| 27 |
+
"split_special_tokens": false,
|
| 28 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 29 |
+
"unk_token": null
|
| 30 |
+
}
|