Zero-Shot Classification
Transformers
qwen3_5
feature-extraction
decision-model
system-one
semantic-router
vela
token-classification
named-entity-recognition
relation-extraction
pii-detection
hallucination-detection
content-safety
multimodal
custom_code
Instructions to use vllm-sr/vela3-flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vllm-sr/vela3-flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="vllm-sr/vela3-flash", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("vllm-sr/vela3-flash", trust_remote_code=True) model = AutoModel.from_pretrained("vllm-sr/vela3-flash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Return invalid_question for malformed span thresholds and instructions
#3
by subin - opened
- SHA256SUMS +1 -1
- modeling_vela3.py +4 -0
SHA256SUMS
CHANGED
|
@@ -7,7 +7,7 @@ e6ec4981046337e0e7e1bf9696ce15d281bdd691188f1adb33e6a8d53466ff0d image_halu_hea
|
|
| 7 |
64d5b39a3997b0263d56e737878e3c4937177fefc30f83d5649880a88433455b image_halu_lora.safetensors
|
| 8 |
4cd699d86c9d41a7947e19ae944541d9d552fc68e94b7c11d40b9b67b1afe62c label_definitions.json
|
| 9 |
3d43ed7f6b0af94195d6ea687a59141384a4fba5a3756016aade8c9c0c208662 labeldef_lm_head.safetensors
|
| 10 |
-
|
| 11 |
cc710bdeb492c51564600ff09b645bce2b716d1fff76e810249b0926dd2e49fe ner_head.safetensors
|
| 12 |
3272c03b55df4927aa733a2b5dc45af1b4474cf2034924b6a8c45a084513b9a7 ner_lora.safetensors
|
| 13 |
8bf595b1d23ea1f6d7dc6f751322dad6ed81b86bf2f0c9669d169aec24013cc2 relation_head.safetensors
|
|
|
|
| 7 |
64d5b39a3997b0263d56e737878e3c4937177fefc30f83d5649880a88433455b image_halu_lora.safetensors
|
| 8 |
4cd699d86c9d41a7947e19ae944541d9d552fc68e94b7c11d40b9b67b1afe62c label_definitions.json
|
| 9 |
3d43ed7f6b0af94195d6ea687a59141384a4fba5a3756016aade8c9c0c208662 labeldef_lm_head.safetensors
|
| 10 |
+
e3e03870b543ba9489986b61268f83c0648654c9d35ebdb4f9851fff20a8876d modeling_vela3.py
|
| 11 |
cc710bdeb492c51564600ff09b645bce2b716d1fff76e810249b0926dd2e49fe ner_head.safetensors
|
| 12 |
3272c03b55df4927aa733a2b5dc45af1b4474cf2034924b6a8c45a084513b9a7 ner_lora.safetensors
|
| 13 |
8bf595b1d23ea1f6d7dc6f751322dad6ed81b86bf2f0c9669d169aec24013cc2 relation_head.safetensors
|
modeling_vela3.py
CHANGED
|
@@ -270,6 +270,10 @@ class Vela3MiniModel(PreTrainedModel):
|
|
| 270 |
raise ValueError("span labels must be distinct")
|
| 271 |
sp = self.vela3_config["span"]; lset = self._label_set(names)
|
| 272 |
question = q.get("instructions")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
route, route_why = self._span_route(lset, names, question)
|
| 274 |
img_halu = bool(images) and lset == "halu" and "image_halu" in sp
|
| 275 |
if lset in sp["schemas"]: # trained router schema: its question text and label descriptions fill what the request leaves empty
|
|
|
|
| 270 |
raise ValueError("span labels must be distinct")
|
| 271 |
sp = self.vela3_config["span"]; lset = self._label_set(names)
|
| 272 |
question = q.get("instructions")
|
| 273 |
+
if question is not None and not isinstance(question, str):
|
| 274 |
+
raise ValueError("span instructions must be a string")
|
| 275 |
+
if not isinstance(q.get("threshold", 0.0), (int, float, str)): # numeric strings still go through float() below
|
| 276 |
+
raise ValueError("threshold must be a number")
|
| 277 |
route, route_why = self._span_route(lset, names, question)
|
| 278 |
img_halu = bool(images) and lset == "halu" and "image_halu" in sp
|
| 279 |
if lset in sp["schemas"]: # trained router schema: its question text and label descriptions fill what the request leaves empty
|