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
Upload runtime_identity.py with huggingface_hub
Browse files- runtime_identity.py +35 -0
runtime_identity.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Explicit corrected-runtime identity; never mutates source weights/config files."""
|
| 2 |
+
import copy
|
| 3 |
+
|
| 4 |
+
RUNTIME_VERSION = 'lemonjev-qwen-decision-runtime-v2'
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def runtime_config(config, model_id, *, step=None, baseline=False):
|
| 8 |
+
if not isinstance(model_id, str) or not model_id.startswith(('lemonjev-', 'lemondecider-')) or model_id == getattr(config, 'model_id', None):
|
| 9 |
+
raise ValueError('A distinct explicit lemonjev- runtime model identity is required')
|
| 10 |
+
result = copy.deepcopy(config)
|
| 11 |
+
result.source_model_id = getattr(config, 'model_id', None)
|
| 12 |
+
result.model_id = model_id
|
| 13 |
+
result.project_name = 'LemonJev'
|
| 14 |
+
result.runtime_version = RUNTIME_VERSION
|
| 15 |
+
result.runtime_override = bool(baseline)
|
| 16 |
+
result.initialization_step = int(getattr(config, 'initialization_step', 0) if step is None else step)
|
| 17 |
+
result.trained = result.initialization_step > 0
|
| 18 |
+
result.temperature = 1.0
|
| 19 |
+
result.calibrated = False
|
| 20 |
+
result.calibration = {'method': 'none', 'temperature': 1.0}
|
| 21 |
+
result.vision_training_mode = 'frozen' # export/serving does not execute dummy training work
|
| 22 |
+
return result
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
def decision_metadata(config):
|
| 26 |
+
return {'schema': 'lemonjev-decision-config-v2', 'model_id': config.model_id,
|
| 27 |
+
'source_model_id': config.source_model_id, 'runtime_version': config.runtime_version,
|
| 28 |
+
'runtime_override': config.runtime_override, 'step': config.initialization_step,
|
| 29 |
+
'trained': config.trained, 'calibrated': config.calibrated,
|
| 30 |
+
'calibration': config.calibration, 'temperature': config.temperature,
|
| 31 |
+
'attention_mode': config.attention_mode, 'pooling': config.pooling,
|
| 32 |
+
'max_input_length': config.max_input_length, 'max_options': config.max_options,
|
| 33 |
+
'code_scheme': config.code_scheme, 'codes': config.codes, 'token_ids': config.token_ids,
|
| 34 |
+
'decision_protocol': getattr(config, 'decision_protocol', 'autojev-v1'),
|
| 35 |
+
'readout_dtype': 'float32' if getattr(config, 'decision_protocol', 'autojev-v1') == 'lemondecider-v1' else 'legacy'}
|