Text Classification
TensorRT
Core ML
ONNX
Safetensors
OpenVINO
code
multilingual
xlm-roberta
knowledge-graph
relation-extraction
relation-classification
cross-encoder
knowledge-distillation
Instructions to use faxenoff/code-daemon-relation-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use faxenoff/code-daemon-relation-v1 with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
compiled artefacts from win_x64 (sm_120)
Browse files- .gitattributes +8 -0
- README.md +161 -93
- code-daemon-relation-v1-l_linux_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-l_ov2026.2_cpu_fp16_b16_s256.bin +3 -0
- code-daemon-relation-v1-l_ov2026.2_cpu_fp16_b16_s256.xml +0 -0
- code-daemon-relation-v1-l_ov2026.2_igpu_fp16_b16_s256.bin +3 -0
- code-daemon-relation-v1-l_ov2026.2_igpu_fp16_b16_s256.xml +0 -0
- code-daemon-relation-v1-l_win_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-m_linux_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-m_ov2026.2_cpu_fp16_b16_s128.bin +3 -0
- code-daemon-relation-v1-m_ov2026.2_cpu_fp16_b16_s128.xml +0 -0
- code-daemon-relation-v1-m_ov2026.2_igpu_fp16_b16_s128.bin +3 -0
- code-daemon-relation-v1-m_ov2026.2_igpu_fp16_b16_s128.xml +0 -0
- code-daemon-relation-v1-m_win_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-s_linux_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-s_ov2026.2_cpu_fp16_b16_s64.bin +3 -0
- code-daemon-relation-v1-s_ov2026.2_cpu_fp16_b16_s64.xml +0 -0
- code-daemon-relation-v1-s_ov2026.2_igpu_fp16_b16_s64.bin +3 -0
- code-daemon-relation-v1-s_ov2026.2_igpu_fp16_b16_s64.xml +0 -0
- code-daemon-relation-v1-s_win_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-xl_linux_x64_trt11.0_sm_120.engine +3 -0
- code-daemon-relation-v1-xl_ov2026.2_cpu_fp16_b16_s320.bin +3 -0
- code-daemon-relation-v1-xl_ov2026.2_cpu_fp16_b16_s320.xml +0 -0
- code-daemon-relation-v1-xl_ov2026.2_igpu_fp16_b16_s320.bin +3 -0
- code-daemon-relation-v1-xl_ov2026.2_igpu_fp16_b16_s320.xml +0 -0
- code-daemon-relation-v1-xl_win_x64_trt11.0_sm_120.engine +3 -0
- manifest.json +18 -0
- model.onnx +2 -2
- model.onnx.data +2 -2
- model_gpu_mlx0.22/config.json +50 -0
.gitattributes
CHANGED
|
@@ -35,3 +35,11 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
model.onnx.data filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
code-daemon-relation-v1-l_linux_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
code-daemon-relation-v1-m_linux_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
code-daemon-relation-v1-s_linux_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
code-daemon-relation-v1-xl_linux_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
code-daemon-relation-v1-l_win_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
code-daemon-relation-v1-m_win_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
code-daemon-relation-v1-s_win_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
code-daemon-relation-v1-xl_win_x64_trt11.0_sm_120.engine filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -4,12 +4,14 @@ language:
|
|
| 4 |
- code
|
| 5 |
- multilingual
|
| 6 |
tags:
|
| 7 |
-
- code
|
| 8 |
- knowledge-graph
|
| 9 |
- relation-extraction
|
|
|
|
| 10 |
- cross-encoder
|
| 11 |
- text-classification
|
| 12 |
- knowledge-distillation
|
|
|
|
|
|
|
| 13 |
pipeline_tag: text-classification
|
| 14 |
base_model:
|
| 15 |
- cross-encoder/mmarco-mMiniLMv2-L12-H384-v1
|
|
@@ -19,131 +21,197 @@ datasets:
|
|
| 19 |
|
| 20 |
# code-daemon-relation-v1
|
| 21 |
|
| 22 |
-
A
|
| 23 |
-
relate** — one of
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
|
| 27 |
-
and
|
| 28 |
-
instead of token-by-token generation. It was **distilled from a 7B instruct model** into a ~117M
|
| 29 |
-
cross-encoder, so it runs on a CPU/iGPU and is fast enough to sweep thousands of entity pairs when
|
| 30 |
-
building a knowledge graph. It is used by the [UltraCode](https://github.com/faxenoff/ultracode) code
|
| 31 |
-
assistant to turn documentation into a graph of related concepts, but nothing about it is specific to
|
| 32 |
-
that tool.
|
| 33 |
|
| 34 |
-
-
|
| 35 |
-
4 entity-marker tokens (`[E1] [/E1] [E2] [/E2]`), so the embedding table is 250 006 rows.
|
| 36 |
-
- **2-input ONNX** (`input_ids`, `attention_mask`; no `token_type_ids`) → **`logits[batch, 8]`**.
|
| 37 |
-
- **Max sequence 256** tokens for the marked passage.
|
| 38 |
-
- **Multilingual** — the XLM-R backbone handles text and code comments in many languages.
|
| 39 |
|
| 40 |
-
## The
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
threshold lets you drop low-confidence pairs.
|
| 45 |
|
| 46 |
| idx | label | meaning |
|
| 47 |
|--:|---|---|
|
| 48 |
-
| 0 | `NO_RELATION` | the two
|
| 49 |
-
| 1 | `semantically_similar_to` | near-duplicate purpose
|
| 50 |
-
| 2 | `
|
| 51 |
-
| 3 | `
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
**
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
*
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
```python
|
| 86 |
-
import
|
| 87 |
from transformers import AutoTokenizer
|
| 88 |
|
| 89 |
-
LABELS = ["NO_RELATION","semantically_similar_to","
|
| 90 |
-
"configured_by","depends_on","contradicts","replaced_by"]
|
| 91 |
|
| 92 |
-
tok = AutoTokenizer.from_pretrained(".")
|
| 93 |
sess = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
|
| 94 |
|
| 95 |
-
def classify(marked_text, max_len=256, tau=0.
|
| 96 |
enc = tok([""], [marked_text], padding="max_length", truncation=True,
|
| 97 |
max_length=max_len, return_tensors="np", return_token_type_ids=False)
|
| 98 |
logits = sess.run(None, {"input_ids": enc["input_ids"].astype(np.int64),
|
| 99 |
"attention_mask": enc["attention_mask"].astype(np.int64)})[0][0]
|
| 100 |
p = np.exp(logits - logits.max()); p /= p.sum()
|
|
|
|
|
|
|
| 101 |
i = int(p.argmax())
|
| 102 |
-
return (LABELS[i], float(p[i])) if i
|
| 103 |
|
| 104 |
-
|
| 105 |
-
# -> ('
|
| 106 |
```
|
| 107 |
|
| 108 |
-
|
|
|
|
| 109 |
|
| 110 |
-
|
| 111 |
-
buckets):
|
| 112 |
|
| 113 |
-
|
| 114 |
-
- **OpenVINO** `code-daemon-relation-v1_ov_{cpu,igpu}_fp16_b16_s256.{xml,bin}` — Intel CPU / iGPU.
|
| 115 |
-
- **Tokenizer** — `tokenizer.json` + `sentencepiece.bpe.model` + `tokenizer_config.json` (XLM-R
|
| 116 |
-
SentencePiece with the 4 `[E1]/[E2]` marker tokens added).
|
| 117 |
-
- **ONNX source** — `model.onnx` (+ `model.onnx.data`) FP32, for standalone `onnxruntime` / `optimum` use.
|
| 118 |
|
| 119 |
-
|
| 120 |
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
which are supplemented with synthetic examples. The abstain class plus a softmax threshold keep
|
| 128 |
-
low-confidence pairs out of the graph. Metrics are advisory — for graph construction, spot-checking the
|
| 129 |
-
edges it produces is the real test.
|
| 130 |
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
|
| 136 |
| Source | Note |
|
| 137 |
|---|---|
|
| 138 |
-
| `cross-encoder/mmarco-mMiniLMv2-L12-H384-v1` (warm-start
|
| 139 |
-
|
|
| 140 |
-
|
|
| 141 |
-
|
| 142 |
-
⚠️ The warm-start base derives from **MS MARCO (non-commercial)**; whether a fine-tuned model inherits
|
| 143 |
-
dataset-use terms is legally unsettled — this is **not legal advice**. Retrain from a permissive base if
|
| 144 |
-
strict compliance is required.
|
| 145 |
|
| 146 |
-
|
|
|
|
|
|
|
| 147 |
|
| 148 |
Warm-started from **[cross-encoder/mmarco-mMiniLMv2-L12-H384-v1](https://huggingface.co/cross-encoder/mmarco-mMiniLMv2-L12-H384-v1)**.
|
| 149 |
-
|
|
|
|
|
|
| 4 |
- code
|
| 5 |
- multilingual
|
| 6 |
tags:
|
|
|
|
| 7 |
- knowledge-graph
|
| 8 |
- relation-extraction
|
| 9 |
+
- relation-classification
|
| 10 |
- cross-encoder
|
| 11 |
- text-classification
|
| 12 |
- knowledge-distillation
|
| 13 |
+
- tensorrt
|
| 14 |
+
- openvino
|
| 15 |
pipeline_tag: text-classification
|
| 16 |
base_model:
|
| 17 |
- cross-encoder/mmarco-mMiniLMv2-L12-H384-v1
|
|
|
|
| 21 |
|
| 22 |
# code-daemon-relation-v1
|
| 23 |
|
| 24 |
+
A **117M-parameter relation classifier**. Mark two entities inside a passage and it answers, in one
|
| 25 |
+
forward pass, **how they relate** — one of three relation types, or *no relation*.
|
| 26 |
+
|
| 27 |
+
It does a job usually handed to a large generative model — read a passage, extract typed relations
|
| 28 |
+
between the things it mentions — as **a single classification** instead of token-by-token generation.
|
| 29 |
+
That makes it cheap enough to sweep an entire corpus: **~2 900 pairs/sec** on a laptop RTX 5060.
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
logits = session.run(None, {"input_ids": ids, "attention_mask": mask})[0] # [B, 4]
|
| 33 |
+
```
|
| 34 |
|
| 35 |
+
Text is fed as an *(empty query, marked passage)* pair. Multilingual — the XLM-R backbone reads prose
|
| 36 |
+
and code comments in many languages.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
+
## 1. The four classes
|
| 41 |
|
| 42 |
+
Wrap each entity in `[E1]…[/E1]` and `[E2]…[/E2]` inside its natural context. Take the `argmax`;
|
| 43 |
+
class 0 is an explicit **abstain**, and a softmax threshold drops the rest of the low-confidence tail.
|
|
|
|
| 44 |
|
| 45 |
| idx | label | meaning |
|
| 46 |
|--:|---|---|
|
| 47 |
+
| 0 | `NO_RELATION` | the two co-occur but are not related — **abstain** |
|
| 48 |
+
| 1 | `semantically_similar_to` | near-duplicate purpose, or the same goal by a different mechanism |
|
| 49 |
+
| 2 | `invalidates_with` | one supersedes, replaces or contradicts the other |
|
| 50 |
+
| 3 | `depends_on` | one requires or configures the other |
|
| 51 |
+
|
| 52 |
+
The taxonomy is deliberately **coarse**. An earlier 8-way version split these into near-synonym pairs
|
| 53 |
+
(`semantically_similar_to` vs `shares_purpose_with`, `replaced_by` vs `contradicts`, `depends_on` vs
|
| 54 |
+
`configured_by`) and the distinctions were not reliably separable from context — the classifier spent
|
| 55 |
+
its capacity on boundaries that downstream consumers then collapsed anyway. Merging them into three
|
| 56 |
+
positives plus abstain is what the model is actually good at.
|
| 57 |
+
|
| 58 |
+
**Decision rule as shipped:** `argmax != NO_RELATION` **and** `1 - softmax[NO_RELATION] >= tau`.
|
| 59 |
+
Gating on the *probability that any relation exists* rather than on the winning class's own
|
| 60 |
+
probability is more robust: when a real relation's mass spreads across two plausible classes, the
|
| 61 |
+
per-class maximum sags while "something is here" stays high.
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
|
| 65 |
+
## 2. Architecture
|
| 66 |
+
|
| 67 |
+
| | |
|
| 68 |
+
|---|---|
|
| 69 |
+
| Warm-start | [`cross-encoder/mmarco-mMiniLMv2-L12-H384-v1`](https://huggingface.co/cross-encoder/mmarco-mMiniLMv2-L12-H384-v1) |
|
| 70 |
+
| Encoder | XLM-RoBERTa, **12 layers / 384 hidden / 12 heads**, FFN 1536 |
|
| 71 |
+
| Vocabulary | **250 006** SentencePiece pieces = 250 002 XLM-R + 4 marker tokens |
|
| 72 |
+
| Markers | `[E1]` `[/E1]` `[E2]` `[/E2]` (ids 250002–250005) |
|
| 73 |
+
| Sequence | **256 tokens** on the shipped engines (64 / 128 / 320 also provided) |
|
| 74 |
+
| Inputs | `input_ids`, `attention_mask` — **no `token_type_ids`** |
|
| 75 |
+
| Output | `logits[batch, 4]` |
|
| 76 |
+
| Parameters | **~117M**, of which 96M is the multilingual embedding table |
|
| 77 |
+
|
| 78 |
+
### Entity-marker pooling, not `[CLS]`
|
| 79 |
+
|
| 80 |
+
The classification head does **not** read the `[CLS]` vector. It mean-pools the hidden states at the
|
| 81 |
+
**entity-start markers** — the `[E1]` and `[E2]` positions — concatenates the two, and passes that
|
| 82 |
+
through a single linear layer.
|
| 83 |
+
|
| 84 |
+
This matters for a relation task. A `[CLS]` vector summarises the whole passage, so the head has to
|
| 85 |
+
recover *which two things* the question is about from a global summary. Reading the marker positions
|
| 86 |
+
instead gives the head both arguments directly and in order, so the relation is scored between the
|
| 87 |
+
two entities rather than inferred from the sentence as a whole. Direction comes free: swap the
|
| 88 |
+
markers and the input genuinely changes.
|
| 89 |
+
|
| 90 |
+
---
|
| 91 |
+
|
| 92 |
+
## 3. How it was made
|
| 93 |
+
|
| 94 |
+
**Warm-started** from a strong multilingual ranking cross-encoder, with its single ranking logit
|
| 95 |
+
replaced by the 4-class marker-pooling head, then fine-tuned by **sequence-level distillation**.
|
| 96 |
+
|
| 97 |
+
A large instruction-tuned LLM (Claude) read real documentation and emitted relation tuples grounded
|
| 98 |
+
in the passage it was shown. Those tuples became the training targets after several filtering passes:
|
| 99 |
+
|
| 100 |
+
- **Grounding** — entity names the teacher marked must actually resolve inside the chunk, which drops
|
| 101 |
+
hallucinated arguments.
|
| 102 |
+
- **Windowing** — the passage is cropped so that both markers survive truncation.
|
| 103 |
+
- **Merging** — the original 8 labels are collapsed to the 4 above.
|
| 104 |
+
- **Negatives** — explicit `NO_RELATION` examples synthesised from co-occurring but untupled entity
|
| 105 |
+
pairs in the same chunk, so abstain is trained rather than inferred.
|
| 106 |
+
- **Logit adjustment** — the class prior is corrected at the loss, since a teacher naturally emits
|
| 107 |
+
"similar" far more often than "depends on".
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
|
| 111 |
+
## 4. Speed
|
| 112 |
+
|
| 113 |
+
Measured on one laptop: Intel Core Ultra 9 275HX / NVIDIA RTX 5060 Laptop.
|
| 114 |
+
|
| 115 |
+
| lane | batch × seq | per batch | throughput | per pair |
|
| 116 |
+
|---|---|--:|--:|--:|
|
| 117 |
+
| **TensorRT FP16, RTX 5060 Laptop** | 16 × 256 | **5.44 ms** | **2 942 pairs/s** | 0.34 ms |
|
| 118 |
+
| OpenVINO FP16, CPU | 16 × 256 | 360 ms | 44 pairs/s | 22.5 ms |
|
| 119 |
+
| ONNX Runtime FP32, CPU | 16 × 256 | 380 ms | 42 pairs/s | 23.7 ms |
|
| 120 |
+
|
| 121 |
+
The GPU lane is ~67× the CPU lane, which is the point: relation extraction over a corpus means tens
|
| 122 |
+
of thousands of candidate pairs, and only the compiled-engine path makes that a background task
|
| 123 |
+
rather than a batch job.
|
| 124 |
+
|
| 125 |
+
Four **length buckets** ship — seq 64 / 128 / 256 / 320 at batch 16. Attention is quadratic in
|
| 126 |
+
sequence length, so routing short passages to a short engine is worth taking when your pairs vary in
|
| 127 |
+
length. Padding is attention-masked, so a pair produces the same logits from any bucket that fits it.
|
| 128 |
+
|
| 129 |
+
---
|
| 130 |
+
|
| 131 |
+
## 5. Standalone use
|
| 132 |
|
| 133 |
```python
|
| 134 |
+
import numpy as np, onnxruntime as ort
|
| 135 |
from transformers import AutoTokenizer
|
| 136 |
|
| 137 |
+
LABELS = ["NO_RELATION", "semantically_similar_to", "invalidates_with", "depends_on"]
|
|
|
|
| 138 |
|
| 139 |
+
tok = AutoTokenizer.from_pretrained(".") # includes the [E1]/[E2] marker tokens
|
| 140 |
sess = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
|
| 141 |
|
| 142 |
+
def classify(marked_text, max_len=256, tau=0.7):
|
| 143 |
enc = tok([""], [marked_text], padding="max_length", truncation=True,
|
| 144 |
max_length=max_len, return_tensors="np", return_token_type_ids=False)
|
| 145 |
logits = sess.run(None, {"input_ids": enc["input_ids"].astype(np.int64),
|
| 146 |
"attention_mask": enc["attention_mask"].astype(np.int64)})[0][0]
|
| 147 |
p = np.exp(logits - logits.max()); p /= p.sum()
|
| 148 |
+
if 1.0 - p[0] < tau: # gate on "any relation at all"
|
| 149 |
+
return "NO_RELATION", float(p[0])
|
| 150 |
i = int(p.argmax())
|
| 151 |
+
return (LABELS[i], float(p[i])) if i else ("NO_RELATION", float(p[0]))
|
| 152 |
|
| 153 |
+
classify("The [E1]FAISS[/E1] index was replaced by the [E2]native IVF[/E2] backend.")
|
| 154 |
+
# -> ('invalidates_with', 0.7x)
|
| 155 |
```
|
| 156 |
|
| 157 |
+
Both entities must appear **inside one passage**, marked in place. The model reads context, so a bare
|
| 158 |
+
pair of names with no surrounding text carries little signal.
|
| 159 |
|
| 160 |
+
---
|
|
|
|
| 161 |
|
| 162 |
+
## 6. Evaluation
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
+
**Dev macro-F1 = 0.547** over the four classes, on a held-out split of the distillation set.
|
| 165 |
|
| 166 |
+
Read that as what it is. The classes are intrinsically imbalanced — a teacher describing
|
| 167 |
+
documentation emits "similar" far more often than "depends on" — and the merged taxonomy still
|
| 168 |
+
contains genuinely ambiguous boundaries that human annotators would also disagree on. The abstain
|
| 169 |
+
class plus the `tau` gate exist because the useful operating point is *high-precision edges*, not
|
| 170 |
+
maximum recall: for building a graph, the real test is spot-checking the edges it emits at your
|
| 171 |
+
chosen threshold.
|
| 172 |
|
| 173 |
+
**Suited to**
|
| 174 |
+
- Turning prose or documentation into a typed concept graph.
|
| 175 |
+
- Any sweep where a large LLM per pair would be too slow or too expensive.
|
| 176 |
+
- Multilingual corpora, including code comments.
|
|
|
|
|
|
|
|
|
|
| 177 |
|
| 178 |
+
**Not suited to**
|
| 179 |
+
- Fine-grained relation ontologies — this is 3 positives plus abstain by design.
|
| 180 |
+
- Entity *extraction*: it classifies pairs you already found, it does not find them.
|
| 181 |
+
- Passages where the two entities are far apart — the marked window is 256 tokens.
|
| 182 |
|
| 183 |
+
---
|
| 184 |
+
|
| 185 |
+
## 7. What is in this repo
|
| 186 |
+
|
| 187 |
+
Compiled engines, named per **runtime × OS × GPU arch**, plus the ONNX for standalone use.
|
| 188 |
+
|
| 189 |
+
- **TensorRT FP16** — `code-daemon-relation-v1-{s,m,l,xl}_{win_x64,linux_x64}_trt11.0_sm_120.engine`
|
| 190 |
+
(buckets seq 64 / 128 / 256 / 320, batch 16).
|
| 191 |
+
- **OpenVINO FP16** — `code-daemon-relation-v1-{s,m,l,xl}_ov2026.2_{cpu,igpu}_fp16_b16_s{64,128,256,320}.{xml,bin}`.
|
| 192 |
+
- **Tokenizer** — `tokenizer.json`, `sentencepiece.bpe.model`, `tokenizer_config.json` (XLM-R
|
| 193 |
+
SentencePiece with the four marker tokens added).
|
| 194 |
+
- **ONNX** — `model.onnx` (+ `model.onnx.data`), FP32, the build source for every engine above.
|
| 195 |
+
|
| 196 |
+
FP16 rather than INT8: this architecture's activation outliers make per-tensor INT8 calibration
|
| 197 |
+
lossy, and FP16 costs nothing on any GPU that can run it.
|
| 198 |
+
|
| 199 |
+
---
|
| 200 |
+
|
| 201 |
+
## 8. License & attribution
|
| 202 |
+
|
| 203 |
+
Released **MIT**.
|
| 204 |
|
| 205 |
| Source | Note |
|
| 206 |
|---|---|
|
| 207 |
+
| `cross-encoder/mmarco-mMiniLMv2-L12-H384-v1` (warm-start) | **mMARCO ← MS MARCO → non-commercial research terms** |
|
| 208 |
+
| Distillation targets (LLM-labelled open-source documentation) | self-generated |
|
| 209 |
+
| Synthesised negatives and rare-class augmentation | generated |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
|
| 211 |
+
⚠️ The warm-start base derives from **MS MARCO (non-commercial)**. Whether a fine-tuned model
|
| 212 |
+
inherits dataset-use terms is legally unsettled — this is **not legal advice**. Retrain from a
|
| 213 |
+
permissive base if strict compliance matters to you.
|
| 214 |
|
| 215 |
Warm-started from **[cross-encoder/mmarco-mMiniLMv2-L12-H384-v1](https://huggingface.co/cross-encoder/mmarco-mMiniLMv2-L12-H384-v1)**.
|
| 216 |
+
Backbone: XLM-RoBERTa. Used by the [UltraCode](https://github.com/faxenoff/ultracode) code assistant,
|
| 217 |
+
though nothing about the model is specific to it.
|
code-daemon-relation-v1-l_linux_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6384775d766d53b6e8ab921f75cf55be1d1d34ddec9904f0a42b4efd402f9232
|
| 3 |
+
size 240376836
|
code-daemon-relation-v1-l_ov2026.2_cpu_fp16_b16_s256.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-l_ov2026.2_cpu_fp16_b16_s256.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-l_ov2026.2_igpu_fp16_b16_s256.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-l_ov2026.2_igpu_fp16_b16_s256.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-l_win_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:76b0a26f0440cc5e4de64cb0cc500c05ee4ab571adda9b0003d3eff91899d1a6
|
| 3 |
+
size 240313476
|
code-daemon-relation-v1-m_linux_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e93f5b3f28f5a330c170abace36214e574d9fe6b40ef64daaedfbc6d2e84519
|
| 3 |
+
size 238266444
|
code-daemon-relation-v1-m_ov2026.2_cpu_fp16_b16_s128.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-m_ov2026.2_cpu_fp16_b16_s128.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-m_ov2026.2_igpu_fp16_b16_s128.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-m_ov2026.2_igpu_fp16_b16_s128.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-m_win_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5bb0bcee5cb2382d51c1e36529306d8545ae5640eb0c99fdde7699e30d857f7a
|
| 3 |
+
size 240300756
|
code-daemon-relation-v1-s_linux_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0db0b50abb3122fc7ad012bc41db40f829bffd3e59c4cccb143a0da8d38a0fc9
|
| 3 |
+
size 236279164
|
code-daemon-relation-v1-s_ov2026.2_cpu_fp16_b16_s64.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-s_ov2026.2_cpu_fp16_b16_s64.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-s_ov2026.2_igpu_fp16_b16_s64.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-s_ov2026.2_igpu_fp16_b16_s64.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-s_win_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1c451d4d9a320e438d61399b3710e11bb14864b48c867fb5e44739be7b2b8c9
|
| 3 |
+
size 238297228
|
code-daemon-relation-v1-xl_linux_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e200a40f8dbf2c7c812a50c5bc5710f734c5f869d3bdb8b3364879b9ef361e3
|
| 3 |
+
size 238387732
|
code-daemon-relation-v1-xl_ov2026.2_cpu_fp16_b16_s320.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-xl_ov2026.2_cpu_fp16_b16_s320.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-xl_ov2026.2_igpu_fp16_b16_s320.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44de7b7cb29d298b215f965e3a1263d9cceaf9256299143d638b5e5edcf398f2
|
| 3 |
+
size 427004618
|
code-daemon-relation-v1-xl_ov2026.2_igpu_fp16_b16_s320.xml
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
code-daemon-relation-v1-xl_win_x64_trt11.0_sm_120.engine
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d83141e50053725d59d49fa6074c1be0db9cce9eace64bd3dceeebfa41961f7
|
| 3 |
+
size 240319756
|
manifest.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_id": "code-daemon-relation-v1",
|
| 3 |
+
"dimension": 4,
|
| 4 |
+
"max_tokens": 256,
|
| 5 |
+
"quantization": "fp16",
|
| 6 |
+
"targets": [
|
| 7 |
+
"openvino",
|
| 8 |
+
"tensorrt"
|
| 9 |
+
],
|
| 10 |
+
"runtime_tags": {
|
| 11 |
+
"trt": "trt11.0",
|
| 12 |
+
"ov": "ov2026.2",
|
| 13 |
+
"tvm": "tvm0.25",
|
| 14 |
+
"mlx_dir": "model_gpu_mlx0.22"
|
| 15 |
+
},
|
| 16 |
+
"compiled_at": "2026-08-03T14:52:04Z",
|
| 17 |
+
"compiled_by": "models/_compile"
|
| 18 |
+
}
|
model.onnx
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73556d636633563bd0688d52899c475ff61a48f0687e8c48703ee4b9bc74d135
|
| 3 |
+
size 1548544
|
model.onnx.data
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b51662317655847207a9b2c146d7a5084310fac4860e7169cd47c1c161e25308
|
| 3 |
+
size 470057984
|
model_gpu_mlx0.22/config.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_cross_attention": false,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"XLMRobertaForSequenceClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"bos_token_id": 0,
|
| 8 |
+
"classifier_dropout": null,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"eos_token_id": 2,
|
| 11 |
+
"hidden_act": "gelu",
|
| 12 |
+
"hidden_dropout_prob": 0.1,
|
| 13 |
+
"hidden_size": 384,
|
| 14 |
+
"id2label": {
|
| 15 |
+
"0": "NO_RELATION",
|
| 16 |
+
"1": "semantically_similar_to",
|
| 17 |
+
"2": "shares_purpose_with",
|
| 18 |
+
"3": "invalidates_with",
|
| 19 |
+
"4": "configured_by",
|
| 20 |
+
"5": "depends_on",
|
| 21 |
+
"6": "contradicts",
|
| 22 |
+
"7": "replaced_by"
|
| 23 |
+
},
|
| 24 |
+
"initializer_range": 0.02,
|
| 25 |
+
"intermediate_size": 1536,
|
| 26 |
+
"is_decoder": false,
|
| 27 |
+
"label2id": {
|
| 28 |
+
"NO_RELATION": 0,
|
| 29 |
+
"configured_by": 4,
|
| 30 |
+
"contradicts": 6,
|
| 31 |
+
"depends_on": 5,
|
| 32 |
+
"invalidates_with": 3,
|
| 33 |
+
"replaced_by": 7,
|
| 34 |
+
"semantically_similar_to": 1,
|
| 35 |
+
"shares_purpose_with": 2
|
| 36 |
+
},
|
| 37 |
+
"layer_norm_eps": 1e-05,
|
| 38 |
+
"max_position_embeddings": 514,
|
| 39 |
+
"model_type": "xlm-roberta",
|
| 40 |
+
"num_attention_heads": 12,
|
| 41 |
+
"num_hidden_layers": 12,
|
| 42 |
+
"pad_token_id": 1,
|
| 43 |
+
"position_embedding_type": "absolute",
|
| 44 |
+
"sbert_ce_default_activation_function": "torch.nn.modules.linear.Identity",
|
| 45 |
+
"tie_word_embeddings": true,
|
| 46 |
+
"transformers_version": "5.1.0",
|
| 47 |
+
"type_vocab_size": 1,
|
| 48 |
+
"use_cache": true,
|
| 49 |
+
"vocab_size": 250006
|
| 50 |
+
}
|