Lightning-AI / Lightning-AI/lit-llama
TypeError: super(type, obj): obj must be an instance or subtype of type
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.1k
- Forks
- 517
- PR merge metrics
- No merged PRs in 30d
Description
Loading model ...
Traceback (most recent call last):
File "/home/Zhengwt/lit-llama/evaluate/lora.py", line 172, in
CLI(main)
File "/home/Zhengwt/anaconda3/envs/lit-llama/lib/python3.9/site-packages/jsonargparse/_cli.py", line 85, in CLI
return _run_component(component, cfg_init)
File "/home/Zhengwt/anaconda3/envs/lit-llama/lib/python3.9/site-packages/jsonargparse/_cli.py", line 147, in _run_component
return component(**cfg)
File "/home/Zhengwt/lit-llama/evaluate/lora.py", line 105, in main
model = LLaMA.from_name(name)
File "/home/Zhengwt/lit-llama/lit_llama/model.py", line 124, in from_name
return cls(LLaMAConfig.from_name(name))
File "/home/Zhengwt/lit-llama/lit_llama/model.py", line 59, in __init__
h=nn.ModuleList(Block(config) for _ in range(config.n_layer)),
File "/home/Zhengwt/anaconda3/envs/lit-llama/lib/python3.9/site-packages/torch/nn/modules/container.py", line 279, in __init__
self += modules
File "/home/Zhengwt/anaconda3/envs/lit-llama/lib/python3.9/site-packages/torch/nn/modules/container.py", line 320, in __iadd__
return self.extend(modules)
File "/home/Zhengwt/anaconda3/envs/lit-llama/lib/python3.9/site-packages/torch/nn/modules/container.py", line 401, in extend
for i, module in enumerate(modules):
File "/home/Zhengwt/lit-llama/lit_llama/model.py", line 59, in
h=nn.ModuleList(Block(config) for _ in range(config.n_layer)),
File "/home/Zhengwt/lit-llama/lit_llama/model.py", line 150, in __init__
self.attn = CausalSelfAttention(config)
File "/home/Zhengwt/lit-llama/lit_llama/lora.py", line 428, in __init__
self.c_attn = MergedLinear(
File "/home/Zhengwt/lit-llama/lit_llama/lora.py", line 134, in __init__
nn.Linear.__init__(self, in_features, out_features, **kwargs)
File "/home/Zhengwt/lit-llama/lit_llama/quantization.py", line 45, in __init__
super().__init__(*args, **kwargs, has_fp16_weights=False, threshold=6.0)
TypeError: super(type, obj): obj must be an instance or subtype of type
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the model-loading failure from evaluate/lora.py and trace the calls through lit_llama/model.py, lit_llama/lora.py, and lit_llama/quantization.py. Compare the relevant PyTorch module initialization paths; done means the reported TypeError no longer occurs when loading the model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100