Feature Extraction
Transformers
Safetensors
lemondecider_decision
decision-model
typed-decisions
multimodal
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
Update code/infer.py
Browse files
infer.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Native multi-question CLI using the same bridge as the evaluated HTTP service."""
|
| 3 |
+
import argparse,json,os
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
from serve_312k import LemonDeciderHFService
|
| 6 |
+
p=argparse.ArgumentParser()
|
| 7 |
+
p.add_argument('--checkpoint',type=Path,default=Path(__file__).resolve().parents[1])
|
| 8 |
+
p.add_argument('--device',default='cuda:0')
|
| 9 |
+
p.add_argument('--input',type=Path,required=True,help='One state/questions HTTP-format JSON request')
|
| 10 |
+
a=p.parse_args()
|
| 11 |
+
os.environ.setdefault('AIS_SERVER_CPU_THREADS','4')
|
| 12 |
+
s=LemonDeciderHFService(a.checkpoint,a.device,None)
|
| 13 |
+
print(json.dumps(s.predict(json.loads(a.input.read_text())),ensure_ascii=False,indent=2))
|