Views
No views yet
lettuce-emb-512d-v3.model.fp32.onnx (full precision)model.int8.onnx (dynamic quantized INT8)model.onnx (FP32 convenience copy)tokenizer.json, tokenizer_config.json, special_tokens_map.json, vocab.txtmodules.json, config_sentence_transformers.json, sentence_bert_config.json1_Pooling/config.json, 2_Dense/config.jsonconfiguration_hf_nomic_bert.py, modeling_hf_nomic_bert.pynomic-ai/nomic-embed-text-v1.5)5124096./output/lettuce-v3-rp-long3student-base: nomic-ai/nomic-embed-text-v1.5teachers: BAAI/bge-m3dim: 512context: 4096teacher-context: 1024pair-batch: 4 (stable setting used for successful resumed run)triplet-batch: 4 (stable setting used for successful resumed run)teacher-batch: 1num-workers: 4epochs: 1 per run segment (continued via resume)30000Heralax/Augmental-Dataset (~7831 rows available in this environment)hard_logic.json with oversampling (typical run value: 12 or higher)qasperqmsumnarrativeqapassage_retrieval_entest (loader falls back to direct JSONL files from THUDM/LongBench data.zip)MultipleNegativesRankingLoss (triplets)CosineSimilarityLoss (teacher-scored pairs)1import numpy as np
2import onnxruntime as ort
3from transformers import AutoTokenizer
4
5model_dir = "./lettuce-emb-512d-v3"
6onnx_path = f"{model_dir}/model.int8.onnx" # or model.fp32.onnx
7
8tokenizer = AutoTokenizer.from_pretrained(model_dir)
9session = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
10
11texts = [
12 "I forgot to mention one important detail.",
13 "There is one important detail I forgot to mention."
14]
15
16inputs = tokenizer(texts, return_tensors="np", padding=True, truncation=True)
17feeds = {
18 "input_ids": inputs["input_ids"],
19 "attention_mask": inputs["attention_mask"],
20}
21if "token_type_ids" in inputs:
22 names = [x.name for x in session.get_inputs()]
23 if "token_type_ids" in names:
24 feeds["token_type_ids"] = inputs["token_type_ids"]
25
26emb = session.run(None, feeds)[0] # [batch, 512]
27emb = emb / np.clip(np.linalg.norm(emb, axis=1, keepdims=True), 1e-12, None)
28print(float(np.dot(emb[0], emb[1])))eval_v3_full.pyeval_v3_extreme.py./output/lettuce-v3-rp-long31PYTORCH_ALLOC_CONF=expandable_segments:True venv/bin/python eval_v3_full.py \
2 --model ./output/lettuce-emb-512d-v3 \
3 --trust-remote-code \
4 --batch-size 32 \
5 --long-batch-size 2 \
6 --long-subset 150 \
7 --logic-limit 460 \
8 --rp-limit 1000 \
9 --retrieval-corpus 10001venv/bin/python eval_v3_extreme.py \
2 --model ./output/lettuce-emb-512d-v3 \
3 --trust-remote-code \
4 --batch-size 8 \
5 --needle-cases 24 \
6 --needle-targets 1024 2048 4096 \
7 --save-json output/lettuce-emb-512d-v3/extreme_metrics.jsoneval_v3_full.py)| Metric | Value |
|---|---|
| logic_triplet_accuracy | 0.9848 |
| logic_mean_margin | 0.1874 |
| rp_recall@1 | 0.0200 |
| rp_recall@5 | 0.1090 |
| rp_recall@10 | 0.1710 |
| rp_mrr | 0.0717 |
| fp_probe_accuracy | 1.0000 |
| fp_probe_mean_margin | 0.4387 |
| long_1024_recall@10 | 0.1867 |
| long_2048_recall@10 | 0.1067 |
| long_4096_recall@10 | 0.1067 |
eval_v3_extreme.py)| Metric | Value |
|---|---|
| logic_role_flip_accuracy | 0.8000 |
| logic_neg_temp_accuracy | 0.6000 |
| coreference_accuracy | 0.6000 |
| rp_overlap_accuracy | 1.0000 |
| needle_1024_accuracy | 0.5833 |
| needle_2048_accuracy | 0.7083 |
| needle_4096_accuracy | 0.7083 |
| extreme_avg_accuracy | 0.7143 |
| extreme_avg_margin | 0.0673 |
extreme_metrics.json.1venv/bin/python - <<'PY'
2import mteb
3from sentence_transformers import SentenceTransformer
4model = SentenceTransformer('./output/lettuce-v3-rp-long3', trust_remote_code=True)
5model.similarity_fn_name = 'cosine'
6tasks = [t for t in mteb.get_tasks(languages=['eng']) if t.metadata.name in ['STSBenchmark','SICK-R','NFCorpus']]
7_ = mteb.evaluate(model, tasks, prediction_folder='./output/mteb_real_predictions', show_progress_bar=True)
8PY| Task | Metric | Score |
|---|---|---|
| STSBenchmark | Spearman (main_score) | 0.8091 |
| STSBenchmark | Pearson | 0.8036 |
| SICK-R | Spearman (main_score) | 0.7816 |
| SICK-R | Pearson | 0.8297 |
| NFCorpus | nDCG@10 | 0.2784 |
| NFCorpus | MAP@10 | 0.0938 |
| NFCorpus | Recall@10 | 0.1271 |
| NFCorpus | MRR@10 | 0.4725 |
mteb_real_results.json.export_v3_onnx.pyopset: 18dynamo=False in script for stability)qint8)model.fp32.onnxmodel.int8.onnxmodel.onnx (FP32 convenience copy)model.int8.onnx is recommended for CPU/mobile usage.