Skip to content

Commit

Permalink
Fixing conversion script to work for code llama (NVIDIA#7997)
Browse files Browse the repository at this point in the history
* Fixing conversion script to work for code llama

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Shanmugam Ramasamy <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 8, 2023
1 parent 663bd0a commit c6cf276
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/nlp_language_modeling/convert_hf_llama_to_nemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ def load_config(llama_config):
nemo_config = OmegaConf.load(
os.path.join(os.path.dirname(__file__), '../../examples/nlp/language_modeling/conf/megatron_llama_config.yaml')
).model

if llama_config.get('rope_theta', None):
nemo_config['rotary_base'] = llama_config['rope_theta']
nemo_config.encoder_seq_length = llama_config['max_position_embeddings']
nemo_config.num_layers = int(llama_config['num_hidden_layers'])
nemo_config.hidden_size = llama_config['hidden_size']
Expand Down

0 comments on commit c6cf276

Please sign in to comment.