fix rope_theta -> rope_parameters['rope_theta'] (#3651)
This commit is contained in:
parent
2769e27566
commit
f3803cdee0
2 changed files with 11 additions and 1 deletions
|
|
@ -562,6 +562,12 @@ for model_name in model_architectures:
|
|||
config = inspect.getsource(eval(config_filename))
|
||||
except:
|
||||
continue
|
||||
if "RopeParameters" in config:
|
||||
try:
|
||||
exec(f"from {config_filepath} import RopeParameters", globals())
|
||||
except:
|
||||
continue
|
||||
|
||||
if "rope_scaling" in config:
|
||||
continue
|
||||
config = re.sub(
|
||||
|
|
|
|||
|
|
@ -1551,7 +1551,11 @@ class LlamaRotaryEmbedding(torch.nn.Module):
|
|||
super().__init__()
|
||||
if config is not None:
|
||||
# [TODO] Hack to pass in config - need to remove later
|
||||
base = config.rope_theta
|
||||
try:
|
||||
base = config.rope_theta
|
||||
except:
|
||||
base = getattr(config, "rope_parameters", {})
|
||||
base = base["rope_theta"]
|
||||
partial_rotary_factor = (
|
||||
config.partial_rotary_factor
|
||||
if hasattr(config, "partial_rotary_factor")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue