Text Classification
Transformers
Safetensors
saif_decision
feature-extraction
typed-decisions
decision-model
system-one
jev-compatible
tool-use
routing
classification
calibration
custom-code
custom_code
Instructions to use GyrTechnology/saif-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GyrTechnology/saif-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="GyrTechnology/saif-4b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("GyrTechnology/saif-4b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download serving/run.py from GyrTechnology/saif-4b: direct link, hf CLI and curl.
- Browser
- Download file 732 Bytes
-
https://huggingface.co/GyrTechnology/saif-4b/resolve/main/serving/run.py
- Command line
-
hf download hf://GyrTechnology/saif-4b/serving/run.py
-
curl -L -o run.py https://huggingface.co/GyrTechnology/saif-4b/resolve/main/serving/run.py
732 Bytes
| """Run a typed decision request from a JSON file.""" | |
| import argparse | |
| import json | |
| from pydantic import ValidationError | |
| from serve import DecisionRequest, load_model | |
| def main(): | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("request", help="System One request JSON file") | |
| args = parser.parse_args() | |
| try: | |
| with open(args.request) as stream: | |
| request = DecisionRequest.model_validate(json.load(stream)) | |
| except (OSError, ValueError, ValidationError) as error: | |
| parser.error(str(error)) | |
| result = load_model().decide(request.state, request.question_dict()) | |
| print(json.dumps(result["answers"], ensure_ascii=False)) | |
| if __name__ == "__main__": | |
| main() | |