Text Classification
Transformers
decision-model
latent-reasoning
recurrent-depth
adaptive-compute
multilingual
Instructions to use d2v1shx/dazo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use d2v1shx/dazo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="d2v1shx/dazo")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("d2v1shx/dazo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Publish Dazo from GitHub 21509c3
Browse files- configuration_dazo.py +7 -4
- dazo/configuration_dazo.py +7 -4
configuration_dazo.py
CHANGED
|
@@ -31,14 +31,12 @@ class DazoConfig(PretrainedConfig):
|
|
| 31 |
convergence_threshold: float = 0.02,
|
| 32 |
correctness_threshold: float = 0.70,
|
| 33 |
freeze_backbone: bool = True,
|
|
|
|
|
|
|
| 34 |
**kwargs,
|
| 35 |
):
|
| 36 |
super().__init__(**kwargs)
|
| 37 |
self.backbone_name = backbone_name
|
| 38 |
-
# Persist the encoder architecture inside Dazo's config. This lets
|
| 39 |
-
# from_pretrained() construct the backbone with AutoModel.from_config()
|
| 40 |
-
# while Transformers is in its meta-device loading context, then load
|
| 41 |
-
# the actual backbone weights from the Dazo checkpoint state dict.
|
| 42 |
self.backbone_config = backbone_config
|
| 43 |
self.context_max_length = context_max_length
|
| 44 |
self.option_max_length = option_max_length
|
|
@@ -58,6 +56,11 @@ class DazoConfig(PretrainedConfig):
|
|
| 58 |
self.convergence_threshold = convergence_threshold
|
| 59 |
self.correctness_threshold = correctness_threshold
|
| 60 |
self.freeze_backbone = freeze_backbone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
self.architectures = ["DazoForDecision"]
|
| 62 |
self.auto_map = {
|
| 63 |
"AutoConfig": "configuration_dazo.DazoConfig",
|
|
|
|
| 31 |
convergence_threshold: float = 0.02,
|
| 32 |
correctness_threshold: float = 0.70,
|
| 33 |
freeze_backbone: bool = True,
|
| 34 |
+
base_compatibility: bool = False,
|
| 35 |
+
recurrent_logit_scale: float = 0.1,
|
| 36 |
**kwargs,
|
| 37 |
):
|
| 38 |
super().__init__(**kwargs)
|
| 39 |
self.backbone_name = backbone_name
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
self.backbone_config = backbone_config
|
| 41 |
self.context_max_length = context_max_length
|
| 42 |
self.option_max_length = option_max_length
|
|
|
|
| 56 |
self.convergence_threshold = convergence_threshold
|
| 57 |
self.correctness_threshold = correctness_threshold
|
| 58 |
self.freeze_backbone = freeze_backbone
|
| 59 |
+
# Old checkpoints omit this flag and therefore retain the original
|
| 60 |
+
# latent-only decoder. New configs can opt into the learnable direct
|
| 61 |
+
# context-option compatibility base score.
|
| 62 |
+
self.base_compatibility = base_compatibility
|
| 63 |
+
self.recurrent_logit_scale = recurrent_logit_scale
|
| 64 |
self.architectures = ["DazoForDecision"]
|
| 65 |
self.auto_map = {
|
| 66 |
"AutoConfig": "configuration_dazo.DazoConfig",
|
dazo/configuration_dazo.py
CHANGED
|
@@ -31,14 +31,12 @@ class DazoConfig(PretrainedConfig):
|
|
| 31 |
convergence_threshold: float = 0.02,
|
| 32 |
correctness_threshold: float = 0.70,
|
| 33 |
freeze_backbone: bool = True,
|
|
|
|
|
|
|
| 34 |
**kwargs,
|
| 35 |
):
|
| 36 |
super().__init__(**kwargs)
|
| 37 |
self.backbone_name = backbone_name
|
| 38 |
-
# Persist the encoder architecture inside Dazo's config. This lets
|
| 39 |
-
# from_pretrained() construct the backbone with AutoModel.from_config()
|
| 40 |
-
# while Transformers is in its meta-device loading context, then load
|
| 41 |
-
# the actual backbone weights from the Dazo checkpoint state dict.
|
| 42 |
self.backbone_config = backbone_config
|
| 43 |
self.context_max_length = context_max_length
|
| 44 |
self.option_max_length = option_max_length
|
|
@@ -58,6 +56,11 @@ class DazoConfig(PretrainedConfig):
|
|
| 58 |
self.convergence_threshold = convergence_threshold
|
| 59 |
self.correctness_threshold = correctness_threshold
|
| 60 |
self.freeze_backbone = freeze_backbone
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
self.architectures = ["DazoForDecision"]
|
| 62 |
self.auto_map = {
|
| 63 |
"AutoConfig": "configuration_dazo.DazoConfig",
|
|
|
|
| 31 |
convergence_threshold: float = 0.02,
|
| 32 |
correctness_threshold: float = 0.70,
|
| 33 |
freeze_backbone: bool = True,
|
| 34 |
+
base_compatibility: bool = False,
|
| 35 |
+
recurrent_logit_scale: float = 0.1,
|
| 36 |
**kwargs,
|
| 37 |
):
|
| 38 |
super().__init__(**kwargs)
|
| 39 |
self.backbone_name = backbone_name
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
self.backbone_config = backbone_config
|
| 41 |
self.context_max_length = context_max_length
|
| 42 |
self.option_max_length = option_max_length
|
|
|
|
| 56 |
self.convergence_threshold = convergence_threshold
|
| 57 |
self.correctness_threshold = correctness_threshold
|
| 58 |
self.freeze_backbone = freeze_backbone
|
| 59 |
+
# Old checkpoints omit this flag and therefore retain the original
|
| 60 |
+
# latent-only decoder. New configs can opt into the learnable direct
|
| 61 |
+
# context-option compatibility base score.
|
| 62 |
+
self.base_compatibility = base_compatibility
|
| 63 |
+
self.recurrent_logit_scale = recurrent_logit_scale
|
| 64 |
self.architectures = ["DazoForDecision"]
|
| 65 |
self.auto_map = {
|
| 66 |
"AutoConfig": "configuration_dazo.DazoConfig",
|