Text Classification
Transformers
Safetensors
English
basedecision_dyno
feature-extraction
decision-model
system-one
decision-index
multiple-choice
calibration
read-twice
custom-code
lora-merged
custom_code
Instructions to use onlyaady/BaseDecision-Dyno with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use onlyaady/BaseDecision-Dyno with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="onlyaady/BaseDecision-Dyno", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("onlyaady/BaseDecision-Dyno", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download inference.py from onlyaady/BaseDecision-Dyno: direct link, hf CLI and curl.
- Browser
- Download file 1.08 kB
-
https://huggingface.co/onlyaady/BaseDecision-Dyno/resolve/main/inference.py
- Command line
-
hf download hf://onlyaady/BaseDecision-Dyno/inference.py
-
curl -L -o inference.py https://huggingface.co/onlyaady/BaseDecision-Dyno/resolve/main/inference.py
1.08 kB
| """Persistent JSONL inference for the v2 standalone candidate.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| import sys | |
| def main(): | |
| p = argparse.ArgumentParser(description=__doc__) | |
| p.add_argument('--model', default=str(Path(__file__).resolve().parent)) | |
| p.add_argument('--mode', choices=('default', 'flash'), default='default') | |
| p.add_argument('--input', type=Path) | |
| a = p.parse_args() | |
| import torch | |
| from transformers import AutoModel | |
| torch.set_num_threads(4); torch.cuda.set_device(0); torch.backends.cuda.enable_cudnn_sdp(False) | |
| model = AutoModel.from_pretrained(a.model, trust_remote_code=True, | |
| local_files_only=Path(a.model).is_dir(), dtype=torch.bfloat16, device_map={'': 'cuda:0'}).eval() | |
| _ = model.processor | |
| stream = a.input.open() if a.input else sys.stdin | |
| try: | |
| for line in stream: | |
| if line.strip(): print(json.dumps(model.decide(json.loads(line), a.mode), ensure_ascii=False, allow_nan=False), flush=True) | |
| finally: | |
| if a.input: stream.close() | |
| if __name__ == '__main__': main() | |