system HF Staff commited on
Commit
c2e30e1
·
verified ·
1 Parent(s): ca7b354

Publish Dazo from GitHub 21509c3

Browse files
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",