matheusrdgsf commited on
Commit
ae03fd3
1 Parent(s): c623546

Update configuration_phi.py

Browse files
Files changed (1) hide show
  1. configuration_phi.py +8 -6
configuration_phi.py CHANGED
@@ -16,14 +16,15 @@
16
  """ Phi model configuration"""
17
 
18
 
19
- from ...configuration_utils import PretrainedConfig
20
- from ...utils import logging
21
 
22
 
23
  logger = logging.get_logger(__name__)
24
 
25
-
26
- # from ..deprecated._archive_maps import PHI_PRETRAINED_CONFIG_ARCHIVE_MAP # noqa: F401, E402
 
27
 
28
 
29
  class PhiConfig(PretrainedConfig):
@@ -179,7 +180,8 @@ class PhiConfig(PretrainedConfig):
179
 
180
  if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
181
  raise ValueError(
182
- "`rope_scaling` must be a dictionary with two fields, `type` and `factor`, " f"got {self.rope_scaling}"
 
183
  )
184
  rope_scaling_type = self.rope_scaling.get("type", None)
185
  rope_scaling_factor = self.rope_scaling.get("factor", None)
@@ -188,4 +190,4 @@ class PhiConfig(PretrainedConfig):
188
  f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
189
  )
190
  if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
191
- raise ValueError(f"`rope_scaling`'s factor field must be a float > 1, got {rope_scaling_factor}")
 
16
  """ Phi model configuration"""
17
 
18
 
19
+ from transformers.configuration_utils import PretrainedConfig
20
+ from transformers.utils import logging
21
 
22
 
23
  logger = logging.get_logger(__name__)
24
 
25
+ PHI_PRETRAINED_CONFIG_ARCHIVE_MAP = {
26
+ "microsoft/phi-1_5": "https://huggingface.co/microsoft/phi-1_5/resolve/main/config.json",
27
+ }
28
 
29
 
30
  class PhiConfig(PretrainedConfig):
 
180
 
181
  if not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:
182
  raise ValueError(
183
+ "`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, "
184
+ f"got {self.rope_scaling}"
185
  )
186
  rope_scaling_type = self.rope_scaling.get("type", None)
187
  rope_scaling_factor = self.rope_scaling.get("factor", None)
 
190
  f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}"
191
  )
192
  if rope_scaling_factor is None or not isinstance(rope_scaling_factor, float) or rope_scaling_factor <= 1.0:
193
+ raise ValueError(f"`rope_scaling`'s factor field must be a float > 1, got {rope_scaling_factor}")