Text Classification
Transformers
Safetensors
English
modernbert
feature-extraction
decision-model
calibration
mcp
distillation
text-embeddings-inference
Instructions to use gparitosh007/decision-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gparitosh007/decision-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="gparitosh007/decision-model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("gparitosh007/decision-model") model = AutoModel.from_pretrained("gparitosh007/decision-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download example.py from gparitosh007/decision-model: direct link, hf CLI and curl.
- Browser
- Download file 861 Bytes
-
https://huggingface.co/gparitosh007/decision-model/resolve/main/example.py
- Command line
-
hf download hf://gparitosh007/decision-model/example.py
-
curl -L -o example.py https://huggingface.co/gparitosh007/decision-model/resolve/main/example.py
861 Bytes
| """Example: load the model in this folder and predict. | |
| Run: python example.py | |
| The flow needs the decision-model package (see the How to use section of | |
| README.md). | |
| """ | |
| import json | |
| from pathlib import Path | |
| from decision_model.model import DecisionModel | |
| HERE = Path(__file__).resolve().parent | |
| REQUEST = { | |
| "state": "Refactor the auth module and add tests. The repo has 40 files.", | |
| "preferences": {"cost": "low cost before speed"}, | |
| "questions": [ | |
| {"id": "model", "type": "choice", "instructions": "Which model must handle this request?", | |
| "criteria": {"haiku": "Short and simple tasks", "sonnet": "Normal coding tasks", "opus": "Long or difficult tasks"}}, | |
| ], | |
| } | |
| def main(): | |
| model = DecisionModel.load(HERE) | |
| result = model.predict(REQUEST) | |
| print(json.dumps(result, indent=2)) | |
| if __name__ == "__main__": | |
| main() | |