Downloads · 30 days
18
100% of all-time downloads
Dibachain/DibaOne-M3
DibaOne-M3 is a text classification model from Dibachain. Use it when you need a label for a piece of text. It is set up for onnx. The card lists the license as cc-by-nc-sa-4.0.
Downloads · 30 days
18
100% of all-time downloads
All-time downloads
18
Public
Parameters
278M
3.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.onnx2 GB · 64%
From the Hugging Face model README
A Persian-first calibrated decision model: choose, verify and grade with an honest confidence مدل تصمیمگیری فارسیمحور با اطمینان کالیبره: انتخاب، درستیسنجی و امتیازدهی
Live demo (runs in your browser) · DibaOne X1 (successor, Apache-2.0) · Dibachain · Compared against: laya
</div>DibaOne M3 is a Persian-first, open-weight calibrated decision model. Give it a context and a typed question, and it returns a decision with a calibrated probability instead of generated text. It answers three kinds of question:
choice: pick one of several options (support routing, intent, topic, product category, "which label fits")noul: is a statement true given the context? (fact checks, answerability for RAG, guardrail yes/no)score: grade on an ordered scale (sentiment, urgency, satisfaction, quality)M3 is a bi-encoder with 278 M parameters: the context+question and every option are embedded by the same 12-layer XLM-R-family transformer encoder, and each option's score is a scaled cosine similarity. Option embeddings can be cached, so one model call can answer many questions over a fixed label set, and it runs on a CPU. It ships as PyTorch weights and as ONNX fp32 / fp16 / int8, and int8 (348 MB) is the recommended CPU build.
Licence: CC BY-NC-SA 4.0, research and non-commercial use only. M3 was trained partly on public research datasets whose licences are non-commercial, so its weights inherit that restriction and the share-alike condition. The table below lists these datasets. For commercial use, use DibaOne X1 (Apache-2.0), which was trained only on our own data and Wikipedia.
Status: previous generation. M3 is the second-to-latest model of the DibaOne decision family, which is under active development. Its successor, X1, is much stronger on agent tool calling and software-development decisions (see the second table). M3 remains the family's model for
noulandscorequestions and for Persian classification-style decisions.
These evaluation sets were built with M3's training data pipeline. Their datasets and families are disjoint from M3's training rows (checked for exact and near duplicates), but the task types are ones M3 was trained on. That makes this table in-domain for M3. laya by convaiinnovations (Apache-2.0), a multi-option decision encoder that scores all options of a question in one forward pass, was evaluated on the same questions zero-shot: it was never trained on these task families. Scored with M3's metric code (accuracy of the top answer, 10-bin expected calibration error).
| M3 | laya (zero-shot) | |
|---|---|---|
| persian_eval_v1 (10,766 native Persian questions): accuracy | .738 | .470 |
| · choice (6,084) | .702 | .451 |
| · noul, yes/no (2,790) | .872 | .684 |
| · score, graded (1,892) | .654 | .215 |
| · calibration error (ECE, lower is better) | .010 | .251 |
| product_eval_v1 (8,822 product use-case questions): accuracy | .747 | .526 |
| · Persian (4,103) / English (4,719) | .731 / .760 | .487 / .559 |
| · calibration error (ECE) | .041 | .253 |
laya answers a question in about 27 ms on an NVIDIA T4 (one pass per question).
These benchmarks were built for M3's successor X1: agent tool calling, dev-path decisions and Wiki Race-style web navigation. M3 was not trained on these task families, and neither was laya. X1 was. Top-1 accuracy.
| model | Dev path (1,602) | Tool call (1,098) | Wiki Race (1,658) |
|---|---|---|---|
DibaOne X1 (best mode, the successor) | .767 | .751 | .279 (fast mode: .428) |
| DibaOne M3 | .351 | .179 | .188 |
| laya (zero-shot) | .336 | .176 | .288 |
| random choice | .135 | .097 | .029 |
M3 and laya are level on dev-path and tool-call decisions. M3 is behind on Wiki Race, and X1 is far ahead on both agent tasks. For agent tool calling and dev-path decisions, use X1.
Persian / English for M3: dev path .313 / .388, tool call .190 / .167, Wiki Race .224 / .151.
Every variant was measured on the full evaluation sets with the same scoring code, using this repository's files. CPU latency is one question per call (context plus 2 to 14 options), 2 threads, Intel Xeon 2.0 GHz, mean over 100 Persian questions (median in brackets).
| variant | file | size | persian_eval_v1 | product_eval_v1 | Dev path | Tool call | Wiki Race | CPU latency |
|---|---|---|---|---|---|---|---|---|
| fp32 | onnx/model.onnx | 1,059 MB | .7375 (ECE .010) | .7465 (ECE .041) | .354 | .177 | .189 | 373 ms (260) |
| fp16 | onnx/model_fp16.onnx | 530 MB | .7378 (ECE .010) | .7471 (ECE .042) | .355 | .179 | .188 | 522 ms (374) |
| int8 (recommended for CPU) | onnx/model_int8.onnx | 348 MB | .7365 (ECE .012) | .7476 (ECE .040) | .350 | .179 | .191 | 341 ms (240) |
Recommendation: use int8 on a CPU. It is the smallest and fastest file, and it stays within 0.001 to 0.004 of fp32 on every set. Use fp16 on a GPU (on a CPU it is the slowest, because most CPUs have no fast fp16 path). The int8 file is dynamic quantisation (int8 weights per channel, activations quantised at run time) with outlier smoothing, and it keeps the feed-forward output projections in fp32. fp32 is the reference. The browser demo defaults to int8. On our 10-example browser check it gave the same top answers as Python, with probabilities within 0.07 because ONNX Runtime Web uses different int8 kernels. The demo's fp32 option matches Python exactly.
pip install onnxruntime tokenizers numpy huggingface_hub
import sys
from huggingface_hub import snapshot_download
sys.path.insert(0, snapshot_download("Dibachain/DibaOne-M3", allow_patterns=["dibaone_m3.py"]))
from dibaone_m3 import DibaOneM3
m3 = DibaOneM3.from_pretrained("Dibachain/DibaOne-M3", variant="int8") # "int8" | "fp16" | "fp32"
print(m3.choice(
state="مشتری میگوید سفارشم دو هفته است نرسیده و میخواهم پولم را پس بگیرید.",
question="این پیام به کدام تیم برود؟",
options=["بازگشت وجه", "پشتیبانی فنی", "فروش", "پیگیری ارسال"]))
print(m3.noul(
state="The package was delivered on Monday and signed for by the customer.",
question="Is this statement true given the text?",
statement="The customer received the package."))
print(m3.score(
state="The app crashes every time I open it. Completely unusable.",
question="How satisfied is this customer?",
levels=["very unsatisfied", "unsatisfied", "neutral", "satisfied", "very satisfied"]))
Each call returns the answer, a calibrated confidence, the probability of every option (or of "true" for noul), and an abstain flag when the confidence is below 0.5. On a GPU, pass providers=["CUDAExecutionProvider", "CPUExecutionProvider"] with onnxruntime-gpu.
Files: model.safetensors + config.json (the encoder in PyTorch, fp32), onnx/model.onnx (fp32), onnx/model_fp16.onnx, onnx/model_int8.onnx, tokenizer.json + tokenizer_config.json, m3_config.json (logit scale, calibration temperatures, input format), dibaone_m3.py (reference inference code, Apache-2.0). Everything loads from this repository.
NOTICE.The M3 weights are released under CC BY-NC-SA 4.0. 487,205 of the 1,183,895 training rows (41%) come from sources with a non-commercial, research-only or unstated licence. The main ones:
| dataset | licence |
|---|---|
| ANLI (rounds 1–3) | CC BY-NC 4.0 |
| ParsiNLU (entailment, sentiment, query paraphrasing, multiple choice) | CC BY-NC-SA 4.0 |
| PersianQA | CC BY-NC-SA 4.0 (per its GitHub release) |
| Customer support tickets | CC BY-NC 4.0 |
| RACE | research, non-commercial |
| Yelp reviews | Yelp dataset terms, non-commercial |
| SciFact | CC BY-NC |
NOTICE lists every training source with its licence, including sources that publish no licence at all. The reference code (dibaone_m3.py) is Apache-2.0. For third-party notices (MIT) for the encoder architecture and tokenizer, see NOTICE.
دیباوان M3 یک مدل تصمیمگیری فارسیمحور و متنباز با اطمینان کالیبره است. یک زمینه و یک پرسشِ نوعدار به آن میدهید. مدل بهجای تولید متن، تصمیم را همراه با احتمالی کالیبرهشده برمیگرداند. سه نوع پرسش را پاسخ میدهد:
choice (چندگزینهای): انتخاب یک گزینه، مثل مسیریابی پیام پشتیبانی، تشخیص نیت، موضوع و دستهی محصولnoul (درست/نادرست): آیا یک گزاره با توجه به متن درست است؟ مثل درستیسنجی، پاسخپذیری برای RAG و گاردریلscore (امتیازدهی): درجهبندی روی یک مقیاس، مثل احساس، فوریت، رضایت و کیفیتM3 یک رمزگذار دوگانه (bi-encoder) با ۲۷۸ میلیون پارامتر است: متن و هر گزینه با یک رمزگذار ترنسفورمر ۱۲ لایه به بردار تبدیل میشوند و امتیاز هر گزینه شباهت کسینوسیِ مقیاسشده است. به همین دلیل روی CPU سریع اجرا میشود. با وزنهای PyTorch و نسخههای ONNX fp32 / fp16 / int8 منتشر شده و نسخهی int8 (۳۴۸ مگابایت) برای CPU پیشنهاد میشود.
مجوز: CC BY-NC-SA 4.0، فقط برای پژوهش و استفادهی غیرتجاری. بخشی از دادهی آموزشی M3 از مجموعهدادههای پژوهشی عمومی با مجوز غیرتجاری آمده است (ANLI و مجموعهی تیکتهای پشتیبانی با CC BY-NC 4.0؛ ParsiNLU و PersianQA با CC BY-NC-SA 4.0؛ RACE و Yelp با شرایط پژوهشی و غیرتجاری؛ SciFact با CC BY-NC). بنابراین وزنهای M3 همین محدودیت و شرط «اشتراک یکسان» را دارند. فهرست کامل منابع در فایل
NOTICEآمده است. برای استفادهی تجاری از DibaOne X1 (مجوز Apache-2.0) استفاده کنید.
وضعیت: نسل قبلی. M3 نسل پیشین خانوادهی تصمیمگیری دیباوان است که در حال توسعهی فعال است. جانشین آن، X1، در ابزارخوانی عامل و تصمیمهای توسعهی نرمافزار بسیار قویتر است.
۱. مجموعههای ارزیابی خود M3 (درونحوزهای برای M3): این مجموعهها از نظر داده با آموزش M3 همپوشانی ندارند، اما نوع وظایف همان است که M3 روی آن آموزش دیده است. laya ساختهی convaiinnovations بهصورت zero-shot و بدون آموزش روی این وظایف سنجیده شد.
| M3 | laya (zero-shot) | |
|---|---|---|
| ارزیابی فارسی (۱۰٬۷۶۶ پرسش فارسیِ بومی): دقت | ۰٫۷۳۸ | ۰٫۴۷۰ |
| چندگزینهای / درستنادرست / امتیازدهی | ۰٫۷۰۲ / ۰٫۸۷۲ / ۰٫۶۵۴ | ۰٫۴۵۱ / ۰٫۶۸۴ / ۰٫۲۱۵ |
| خطای کالیبراسیون (ECE، کمتر بهتر) | ۰٫۰۱۰ | ۰٫۲۵۱ |
| ارزیابی کاربردهای محصول (۸٬۸۲۲ پرسش): دقت | ۰٫۷۴۷ | ۰٫۵۲۶ |
| فارسی / انگلیسی | ۰٫۷۳۱ / ۰٫۷۶۰ | ۰٫۴۸۷ / ۰٫۵۵۹ |
۲. سه بنچمارک X1 (بخش آزمون): مسیر توسعه، ابزارخوانی و Wiki Race. M3 به ترتیب ۰٫۳۵۱ / ۰٫۱۷۹ / ۰٫۱۸۸، laya (zero-shot) ۰٫۳۳۶ / ۰٫۱۷۶ / ۰٫۲۸۸ و X1 ۰٫۷۶۷ / ۰٫۷۵۱ / ۰٫۴۲۸ (در Wiki Race با حالت fast). برای ابزارخوانی عامل و تصمیمهای توسعه، X1 را به کار ببرید.
کد بخش انگلیسی را ببینید: DibaOneM3.from_pretrained("Dibachain/DibaOne-M3") و سپس m3.choice(...)، m3.noul(...) یا m3.score(...). پرسش، متن و گزینهها میتوانند فارسی باشند. همهی فایلها از همین مخزن بارگیری میشوند و نیازی به توکن نیست. دموی آنلاین کاملاً داخل مرورگر شما اجرا میشود.
| number(s) | source | run |
|---|---|---|
| M3 on persian_eval_v1 / product_eval_v1 (accuracy, by type, by language, ECE) | dibaone_m3-base.json (M3's evaluation report) | full-precision evaluation after training, calibrated with the dev-fitted temperatures. Reproduced with this repository's ONNX files, see the variant table |
| laya on persian_eval_v1 / product_eval_v1 | report.laya-zeroshot.m3evals.json | convaiinnovations/laya, multilingual/ checkpoint as published, zero-shot, NVIDIA T4, 2026-09-24, one question per call, scored with M3's metric code |
| M3 on the X1 benchmarks | results/{devpath,toolcall,wikirace}_v1.test.m3.json | 2026-09-19, ONNX int8 served over M3's API, scored with the X1 benchmark scorer |
| laya on the X1 benchmarks | report.laya-zeroshot.test.json | 2026-09-24, NVIDIA T4, zero-shot |
| X1 on the X1 benchmarks | report.x1-v1.test.json, report.x1-public.test.json | official X1 test run and its re-run through the published files |
| ONNX variants | report.m3-eval.json | 2026-09-24, this repository's files: fp32/fp16 on an NVIDIA T4 (ONNX Runtime CUDA), int8 on CPU; CPU latency on Intel Xeon 2.0 GHz, 2 threads |
DibaOne, the decision family by Dibachain · DibaOne X1 · Diba-Base · Diba-Embed
Persian decision model · calibrated multiple-choice model · Persian NLI and sentiment · مدل تصمیمگیری فارسی · مدل متنباز فارسی
</div>