EverMind-AI commited on
Commit
c61e59c
·
verified ·
1 Parent(s): e773f61

Update card and sentence-transformers config

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 CHANGED
@@ -1,9 +1,10 @@
1
  ---
2
  license: apache-2.0
3
  base_model: Qwen/Qwen3-Embedding-0.6B
4
- library_name: transformers
5
  pipeline_tag: feature-extraction
6
  tags:
 
7
  - sentence-similarity
8
  - retrieval
9
  - agent-skills
@@ -23,7 +24,9 @@ neighbour. Fine-tuned from
23
  [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B).
24
 
25
  Paired with [skillcorpus-reranker-0.6b](https://huggingface.co/EverMind-AI/skillcorpus-reranker-0.6b),
26
- which reranks this model's top candidates.
 
 
27
 
28
  | Property | Value |
29
  |---|---|
@@ -34,6 +37,9 @@ which reranks this model's top candidates.
34
  | Pooling | last token |
35
  | Normalization | L2 |
36
 
 
 
 
37
  ## Usage
38
 
39
  The two sides are encoded asymmetrically — a task description carries an
@@ -80,14 +86,48 @@ query = embed([QUERY_INSTRUCTION + "resolve conflicts after a git merge"])
80
  docs = embed([doc("resolve-conflicts", "Resolve git merge conflicts.", "..."),
81
  doc("sourdough", "Bake sourdough bread.", "...")])
82
  print((query @ docs.T).tolist())
83
- # -> [[0.74, 0.06]]
84
  ```
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  ## Intended use
87
 
88
  First-stage retrieval over a large skill registry: encode the registry offline,
89
- encode each incoming task online, take the top K by cosine similarity (K=20 or
90
- 50 is typical), then rerank with
91
  [skillcorpus-reranker-0.6b](https://huggingface.co/EverMind-AI/skillcorpus-reranker-0.6b).
92
  Not a generative model — it produces embeddings, not answers.
93
 
 
1
  ---
2
  license: apache-2.0
3
  base_model: Qwen/Qwen3-Embedding-0.6B
4
+ library_name: sentence-transformers
5
  pipeline_tag: feature-extraction
6
  tags:
7
+ - transformers
8
  - sentence-similarity
9
  - retrieval
10
  - agent-skills
 
24
  [Qwen/Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B).
25
 
26
  Paired with [skillcorpus-reranker-0.6b](https://huggingface.co/EverMind-AI/skillcorpus-reranker-0.6b),
27
+ which reranks this model's top candidates. The skill documents it was built to
28
+ index have the schema of
29
+ [skillcorpus-demo-1k](https://huggingface.co/datasets/EverMind-AI/skillcorpus-demo-1k).
30
 
31
  | Property | Value |
32
  |---|---|
 
37
  | Pooling | last token |
38
  | Normalization | L2 |
39
 
40
+ Requires `transformers>=4.56` (the `dtype=` argument was named `torch_dtype=`
41
+ before that) or `sentence-transformers>=3.0`.
42
+
43
  ## Usage
44
 
45
  The two sides are encoded asymmetrically — a task description carries an
 
86
  docs = embed([doc("resolve-conflicts", "Resolve git merge conflicts.", "..."),
87
  doc("sourdough", "Bake sourdough bread.", "...")])
88
  print((query @ docs.T).tolist())
89
+ # -> [[0.75, 0.07]]
90
  ```
91
 
92
+ Exact scores shift in the last decimal with dtype and hardware; the ordering is
93
+ what matters.
94
+
95
+ ### With sentence-transformers
96
+
97
+ The repo ships a sentence-transformers configuration (last-token pooling + L2
98
+ normalization, and the query instruction registered as the `query` prompt), so
99
+ this path is equivalent to the code above, up to bf16 noise:
100
+
101
+ ```python
102
+ from sentence_transformers import SentenceTransformer
103
+
104
+ st = SentenceTransformer("EverMind-AI/skillcorpus-embedding-0.6b")
105
+ q = st.encode(["resolve conflicts after a git merge"], prompt_name="query")
106
+ d = st.encode(["resolve-conflicts | Resolve git merge conflicts. | ...",
107
+ "sourdough | Bake sourdough bread. | ..."])
108
+ print(st.similarity(q, d))
109
+ ```
110
+
111
+ Pass `prompt_name="query"` for tasks and nothing for skill documents — that is
112
+ the asymmetry above, applied for you.
113
+
114
+ ### Truncation used in training
115
+
116
+ Beyond the token-level `max_length`, each field was cut to a fixed number of
117
+ **characters** before the strings were assembled. Matching this keeps inference
118
+ inputs on the same distribution as training:
119
+
120
+ | field | limit |
121
+ |---|---|
122
+ | task description (after the instruction prefix) | 1,500 chars |
123
+ | skill `description` | 500 chars |
124
+ | skill `body` | 8,000 chars |
125
+
126
  ## Intended use
127
 
128
  First-stage retrieval over a large skill registry: encode the registry offline,
129
+ encode each incoming task online, take the top K by cosine similarity (K in the
130
+ 20–50 range is typical), then rerank that shortlist with
131
  [skillcorpus-reranker-0.6b](https://huggingface.co/EverMind-AI/skillcorpus-reranker-0.6b).
132
  Not a generative model — it produces embeddings, not answers.
133
 
config_sentence_transformers.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "prompts": {
3
+ "query": "Instruct: Given a task description, retrieve the most relevant skill document that would help an agent complete the task\nQuery:",
4
+ "document": ""
5
+ },
6
+ "default_prompt_name": null,
7
+ "similarity_fn_name": "cosine"
8
+ }
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
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 2048,
3
+ "do_lower_case": false
4
+ }