Text Classification
Transformers
Safetensors
English
qwen3_5
feature-extraction
decision-model
classification
Instructions to use Futurix-AI/FxAI-decision-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Futurix-AI/FxAI-decision-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="Futurix-AI/FxAI-decision-model")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("Futurix-AI/FxAI-decision-model") model = AutoModel.from_pretrained("Futurix-AI/FxAI-decision-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download example.py from Futurix-AI/FxAI-decision-model: direct link, hf CLI and curl.
- Browser
- Download file 2.28 kB
-
https://huggingface.co/Futurix-AI/FxAI-decision-model/resolve/main/example.py
- Command line
-
hf download hf://Futurix-AI/FxAI-decision-model/example.py
-
curl -L -o example.py https://huggingface.co/Futurix-AI/FxAI-decision-model/resolve/main/example.py
2.28 kB
| """Small text-only inference example for the self-contained FxAI checkpoint.""" | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import sys | |
| from pathlib import Path | |
| # Running the example inside an upload folder should not create *.pyc files. | |
| sys.dont_write_bytecode = True | |
| from futurix_decision import DecisionInput, load_model | |
| def parse_option(value: str) -> tuple[str, str]: | |
| name, separator, description = value.partition("=") | |
| if not separator or not name.strip() or not description.strip(): | |
| raise argparse.ArgumentTypeError("options must use NAME=DESCRIPTION") | |
| return name.strip(), description.strip() | |
| def main() -> None: | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--checkpoint", type=Path, default=Path(__file__).resolve().parent) | |
| parser.add_argument("--device", default="cuda:0") | |
| parser.add_argument( | |
| "--state", | |
| default="My integration keeps failing. Please help.", | |
| help="Text to classify.", | |
| ) | |
| parser.add_argument( | |
| "--instructions", | |
| default="Which team should handle this request?", | |
| help="Question shown to the decision model.", | |
| ) | |
| parser.add_argument( | |
| "--option", | |
| action="append", | |
| type=parse_option, | |
| metavar="NAME=DESCRIPTION", | |
| help="Candidate decision option; repeat for multiple options.", | |
| ) | |
| parser.add_argument("--max-image-pixels", type=int, default=512 * 512) | |
| args = parser.parse_args() | |
| options = args.option or [ | |
| ("billing", "Charges and refunds"), | |
| ("support", "Technical integration errors"), | |
| ("sales", "Questions about purchasing the product"), | |
| ] | |
| if len({name for name, _ in options}) != len(options): | |
| parser.error("option names must be unique") | |
| model = load_model( | |
| args.checkpoint, | |
| family="fxai", | |
| device=args.device, | |
| max_image_pixels=args.max_image_pixels, | |
| ) | |
| row = DecisionInput( | |
| state=args.state, | |
| question=args.instructions, | |
| options=[name for name, _ in options], | |
| candidate_descriptions=[description for _, description in options], | |
| ) | |
| print(json.dumps(model.decide(row).to_dict(), indent=2)) | |
| if __name__ == "__main__": | |
| main() | |