Zero-Shot Classification
Transformers
Safetensors
English
ultrabert
feature-extraction
decision-model
system-one
semantic-router
vela
encoder
token-classification
named-entity-recognition
relation-extraction
pii-detection
hallucination-detection
content-safety
custom_code
Instructions to use vllm-sr/vela3-fast with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vllm-sr/vela3-fast with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="vllm-sr/vela3-fast", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("vllm-sr/vela3-fast", trust_remote_code=True) model = AutoModel.from_pretrained("vllm-sr/vela3-fast", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download ub_d3_common.py from vllm-sr/vela3-fast: direct link, hf CLI and curl.
- Browser
- Download file 1.85 kB
-
https://huggingface.co/vllm-sr/vela3-fast/resolve/main/ub_d3_common.py
- Command line
-
hf download hf://vllm-sr/vela3-fast/ub_d3_common.py
-
curl -L -o ub_d3_common.py https://huggingface.co/vllm-sr/vela3-fast/resolve/main/ub_d3_common.py
1.85 kB
| """ub_d3_common.py (UBD3, 16 Oct 2026): one rendering of a typed decision (Decision Index wire format: state + {type, instructions, | |
| criteria}) into the UBENC row contract, shared by the d3 data prep (training rows) and the Decision Index engine (inference), so | |
| train and test see byte-identical inputs. | |
| state -> one part, role "user": the string as is, or a JSON object as compact JSON (the kit's base.text rendering); | |
| instructions -> the question text (string as is, object as compact JSON); | |
| choice -> options {key: description or ""} in criteria order (the encoder reads "key: description", or "key" alone); | |
| noul -> a 2-option choice {"no": "", "yes": ""}; the answer is p(yes). | |
| The question is marked nodrop: training never drops options (d3 trains on the full option set, only re-permuted), and has no [ABS].""" | |
| import json | |
| NOUL_OPTIONS = {"no": "", "yes": ""} | |
| def text(x): | |
| return x if isinstance(x, str) else json.dumps(x, ensure_ascii=False, separators=(",", ":")) | |
| def options_of(q): | |
| if q["type"] == "noul": | |
| return dict(NOUL_OPTIONS) | |
| return {str(k): ("" if v is None else text(v)) for k, v in q["criteria"].items()} | |
| def to_row(rid, state, q, gold=None, soft=None, weight=1.0): | |
| """state: str | object; q: {type, instructions, criteria?}. gold: option name (noul: "yes"/"no"); soft: {option name: prob}.""" | |
| opts = options_of(q) | |
| qq = dict(id="d3:" + q["type"], type="choice", over="user", text=text(q.get("instructions", "")), question_paraphrases=[], | |
| options=opts, abstain=False, nodrop=True, gold=gold if gold is not None else next(iter(opts))) | |
| if soft is not None: | |
| qq["soft"] = soft | |
| if weight != 1.0: | |
| qq["weight"] = weight | |
| return dict(id=rid, parts=[dict(role="user", text=text(state if state is not None else ""))], questions=[qq]) | |