Text Classification
Transformers
ONNX
Safetensors
English
distilbert
intent-classification
multitask
iab
conversational-ai
adtech
calibrated-confidence
text-embeddings-inference
Instructions to use admesh/agentic-intent-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use admesh/agentic-intent-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="admesh/agentic-intent-classifier")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("admesh/agentic-intent-classifier", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Upload multitask_runtime.py with huggingface_hub
Browse files- multitask_runtime.py +18 -8
multitask_runtime.py
CHANGED
|
@@ -8,14 +8,24 @@ from pathlib import Path
|
|
| 8 |
import torch
|
| 9 |
from transformers import AutoTokenizer
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
def round_score(value: float) -> float:
|
|
|
|
| 8 |
import torch
|
| 9 |
from transformers import AutoTokenizer
|
| 10 |
|
| 11 |
+
try:
|
| 12 |
+
from .config import ( # type: ignore
|
| 13 |
+
CALIBRATION_ARTIFACTS_DIR,
|
| 14 |
+
DECISION_PHASE_HEAD_CONFIG,
|
| 15 |
+
INTENT_HEAD_CONFIG,
|
| 16 |
+
MULTITASK_INTENT_MODEL_DIR,
|
| 17 |
+
SUBTYPE_HEAD_CONFIG,
|
| 18 |
+
)
|
| 19 |
+
from .multitask_model import MultiTaskIntentModel, MultiTaskLabelSizes # type: ignore
|
| 20 |
+
except ImportError:
|
| 21 |
+
from config import (
|
| 22 |
+
CALIBRATION_ARTIFACTS_DIR,
|
| 23 |
+
DECISION_PHASE_HEAD_CONFIG,
|
| 24 |
+
INTENT_HEAD_CONFIG,
|
| 25 |
+
MULTITASK_INTENT_MODEL_DIR,
|
| 26 |
+
SUBTYPE_HEAD_CONFIG,
|
| 27 |
+
)
|
| 28 |
+
from multitask_model import MultiTaskIntentModel, MultiTaskLabelSizes
|
| 29 |
|
| 30 |
|
| 31 |
def round_score(value: float) -> float:
|