Skip to content

Commit

Permalink
Read rope_theta for DBRX model (thanks turboderp)
Browse files Browse the repository at this point in the history
  • Loading branch information
oobabooga committed Apr 2, 2024
1 parent db5f6cd commit 9ab7365
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/models_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def get_model_metadata(model):

if 'rope_theta' in metadata:
model_settings['rope_freq_base'] = metadata['rope_theta']
elif 'attn_config' in metadata and 'rope_theta' in metadata['attn_config']:
model_settings['rope_freq_base'] = metadata['attn_config']['rope_theta']

if 'rope_scaling' in metadata and type(metadata['rope_scaling']) is dict and all(key in metadata['rope_scaling'] for key in ('type', 'factor')):
if metadata['rope_scaling']['type'] == 'linear':
Expand Down

0 comments on commit 9ab7365

Please sign in to comment.