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
File size: 1,082 Bytes
fc43746 4c87263 fc43746 4c87263 fc43746 4c87263 fc43746 4c87263 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | """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()
|