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 runtime_identity.py
Browse files- runtime_identity.py +17 -6
runtime_identity.py
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
|
|
| 1 |
"""Explicit corrected-runtime identity; never mutates source weights/config files."""
|
| 2 |
import copy
|
| 3 |
|
| 4 |
-
RUNTIME_VERSION = '
|
|
|
|
|
|
|
| 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(
|
| 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 = '
|
| 14 |
-
result.
|
|
|
|
|
|
|
|
|
|
| 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
|
|
@@ -31,5 +37,10 @@ def decision_metadata(config):
|
|
| 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', '
|
| 35 |
-
'readout_dtype': 'float32' if getattr(config, 'decision_protocol', '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Author:忍把浮名,换了浅斟低唱
|
| 2 |
"""Explicit corrected-runtime identity; never mutates source weights/config files."""
|
| 3 |
import copy
|
| 4 |
|
| 5 |
+
RUNTIME_VERSION = 'lemondecider-qwen-decision-runtime-v3'
|
| 6 |
+
SEAL = '忍把浮名,换了浅斟低唱' # personal mark of the author
|
| 7 |
+
SEAL_OWNER = '浅斟'
|
| 8 |
|
| 9 |
|
| 10 |
def runtime_config(config, model_id, *, step=None, baseline=False):
|
| 11 |
+
if not isinstance(model_id, str) or not model_id.startswith('lemonjev-') or model_id == getattr(config, 'model_id', None):
|
| 12 |
raise ValueError('A distinct explicit lemonjev- runtime model identity is required')
|
| 13 |
result = copy.deepcopy(config)
|
| 14 |
result.source_model_id = getattr(config, 'model_id', None)
|
| 15 |
result.model_id = model_id
|
| 16 |
+
result.project_name = 'LemonDecider'
|
| 17 |
+
result.author = SEAL
|
| 18 |
+
result.author_line = 'Author:' + SEAL
|
| 19 |
+
result.runtime_version = ('lemonjev-spark-decision-runtime-v1'
|
| 20 |
+
if getattr(config, 'backbone_type', None) == 'spark2_5' else RUNTIME_VERSION)
|
| 21 |
result.runtime_override = bool(baseline)
|
| 22 |
result.initialization_step = int(getattr(config, 'initialization_step', 0) if step is None else step)
|
| 23 |
result.trained = result.initialization_step > 0
|
|
|
|
| 37 |
'attention_mode': config.attention_mode, 'pooling': config.pooling,
|
| 38 |
'max_input_length': config.max_input_length, 'max_options': config.max_options,
|
| 39 |
'code_scheme': config.code_scheme, 'codes': config.codes, 'token_ids': config.token_ids,
|
| 40 |
+
'decision_protocol': getattr(config, 'decision_protocol', 'lemondecider-v1'),
|
| 41 |
+
'readout_dtype': 'float32' if getattr(config, 'decision_protocol', 'lemondecider-v1') == 'd3-v1' else 'legacy',
|
| 42 |
+
**({'backbone_type': 'spark2_5', 'media_support': 'text-only',
|
| 43 |
+
'full_attention': 'bidirectional-valid-keys' if config.attention_mode == 'noncausal_full_attention' else 'causal-valid-keys',
|
| 44 |
+
'sliding_attention': 'causal-valid-keys', 'sliding_window': config.spark_config.sliding_window,
|
| 45 |
+
'rope_positions': 'physical-sequence-no-cache'} if getattr(config, 'backbone_type', None) == 'spark2_5' else {})}
|
| 46 |
+
|