Feature Extraction
Transformers
Safetensors
lemondecider_decision
decision-engine
typed-decision
choice
classification
Merge
qwen3.5
custom_code
Instructions to use inclusionAI/LemonDecider with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use inclusionAI/LemonDecider with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="inclusionAI/LemonDecider", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("inclusionAI/LemonDecider", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download code/probe_joint.py from inclusionAI/LemonDecider: direct link, hf CLI and curl.
- Browser
- Download file 1.83 kB
-
https://huggingface.co/inclusionAI/LemonDecider/resolve/main/code/probe_joint.py
- Command line
-
hf download hf://inclusionAI/LemonDecider/code/probe_joint.py
-
curl -L -o probe_joint.py https://huggingface.co/inclusionAI/LemonDecider/resolve/main/code/probe_joint.py
1.83 kB
| #!/usr/bin/env python3 | |
| """GPU probe of short and recursive-chunk paths; no benchmark data required.""" | |
| import argparse,copy,json | |
| from pathlib import Path | |
| p=argparse.ArgumentParser();p.add_argument('--checkpoint',type=Path,required=True);p.add_argument('--device',default='cuda:0');a=p.parse_args() | |
| from serve_312k import LemonDeciderHFService | |
| s=LemonDeciderHFService(a.checkpoint,a.device,None) | |
| short=json.loads((Path(__file__).resolve().parents[1]/'examples/request.json').read_text()) | |
| long={'state':'Synthetic chunk-planning regression.','questions':{str(i):{'type':'choice','instructions':'Choose one.','criteria':{'a':'alpha '*80,'b':'beta '*80}} for i in range(64)}} | |
| reports=[] | |
| for body,split in [(short,False),(long,True)]: | |
| before=copy.deepcopy(body) | |
| rows=[{'state':body['state'],'question':q,'images':[]} for q in body['questions'].values()] | |
| chunks=s.plan(rows) | |
| assert (len(chunks)>1)==split | |
| assert [r for c in chunks for r in c]==rows | |
| assert all(s.joint.unit_lengths(s.processor,s.model.config,[c])[0]<=8192 for c in chunks) | |
| actual=s.predict(body);answers=[];tokens=0 | |
| for c in chunks: | |
| result=s.predict_joint(s.model,s.processor,c);answers.extend(result['answers']);tokens+=result['input_tokens'] | |
| assert list(actual['answers'].values())==answers | |
| assert actual['usage']['input_tokens']==tokens and list(actual['answers'])==list(body['questions']) | |
| assert body==before | |
| reports.append({'split':split,'chunk_sizes':[len(c) for c in chunks],'native_per_chunk_parity':True,'input_tokens':tokens}) | |
| try:s.predict({'state':'hello '*20000,'questions':{'q':short['questions']['intent']}}) | |
| except ValueError as e:assert 'exceeds' in str(e) and 'truncated' in str(e) | |
| else:raise AssertionError('Oversized singleton was not rejected') | |
| print(json.dumps({'passed':True,'cases':reports,'singleton_rejected':True},indent=2)) | |