microsoft / microsoft/KBLaM

cannot import name 'LlamaDynamicNTKScalingRotaryEmbedding'

Open
#35 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
1.5k
Forks
125
Avg merge
22d 8m
Merged PRs (30d)
1

Description

Training as proposed in the README or executing the 3rd cell of the eval_acc.ipynb gives the following error:

File ~/Thomas/KBLaM/src/kblam/models/llama3_model.py:43
38 from transformers.modeling_outputs import (
39 BaseModelOutputWithPast,
40 CausalLMOutputWithPast,
41 )
42 from transformers.models.llama.configuration_llama import LlamaConfig
---> 43 from transformers.models.llama.modeling_llama import (
44 _CONFIG_FOR_DOC,
45 LLAMA_INPUTS_DOCSTRING,
46 LLAMA_START_DOCSTRING,
47 LlamaDynamicNTKScalingRotaryEmbedding,
48 LlamaLinearScalingRotaryEmbedding,
49 LlamaMLP,
50 LlamaPreTrainedModel,
51 LlamaRMSNorm,
52 LlamaRotaryEmbedding,
53 apply_rotary_pos_emb,
54 repeat_kv,
55 )
56 from transformers.utils import (
57 add_start_docstrings,
58 add_start_docstrings_to_model_forward,
59 logging,
60 replace_return_docstrings,
61 )
63 from kblam.models.kblam_config import KBLaMConfig

ImportError: cannot import name 'LlamaDynamicNTKScalingRotaryEmbedding' from 'transformers.models.llama.modeling_llama' (/home/fokus/miniforge3/envs/kblam/lib/python3.13/site-packages/transformers/models/llama/modeling_llama.py)

The transformers lib doesn't define LlamaDynamicNTKScalingRotaryEmbedding. Hence, the "transformers==4.48.0" in pyproject seems to be wrong.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking the transformers version in pyproject and the imports in src/kblam/models/llama3_model.py, then reproduce the failure from the README training flow or the third cell of eval_acc.ipynb. Done means the documented training and evaluation entry points run without the LlamaDynamicNTKScalingRotaryEmbedding import error.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.