facebookresearch / facebookresearch/blt
LMTransformer.__init__() missing 1 required positional argument: 'args'
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
Typing command:
```
python -m bytelatent.hf load-transformers --entropy-repo facebook/blt-entropy --blt-repo facebook/blt-1b --prompt "My test prompt" hub
```
i see
```
╭────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /home/daniel/exp/cnn/blt/bytelatent/hf.py:155 in load_transformers │
│ │
│ 152 │ │ print(blt_model) ╭─────────────── locals ────────────────╮ │
│ 153 │ │ print(tok_and_patcher) │ blt_dir = None │ │
│ 154 │ elif source == "hub": │ blt_repo = 'facebook/blt-1b' │ │
│ ❱ 155 │ │ entropy_model = LMTransformer.from_pretrained(entropy_repo) │ entropy_dir = None │ │
│ 156 │ │ blt_model = ByteLatentTransformer.from_pretrained(blt_repo) │ entropy_repo = 'facebook/blt-entropy' │ │
│ 157 │ │ tok_and_patcher = BltTokenizerAndPatcher.from_pretrained(blt_repo) │ prompt = 'My test prompt' │ │
│ 158 │ │ tokenizer = tok_and_patcher.tokenizer_args.build() │ source = 'hub' │ │
│ ╰───────────────────────────────────────╯ │
│ │
│ /home/daniel/miniconda3/envs/blt/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py:114 in _inner_fn │
│ │
│ 111 │ │ if check_use_auth_token: │
│ 112 │ │ │ kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.__name__, has_token=ha │
│ 113 │ │ │
│ ❱ 114 │ │ return fn(*args, **kwargs) │
│ 115 │ │
│ 116 │ return _inner_fn # type: ignore │
│ 117 │
│ │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ arg_name = 'pretrained_model_name_or_path' │ │
│ │ arg_value = 'facebook/blt-entropy' │ │
│ │ args = (, 'facebook/blt-entropy') │ │
│ │ check_use_auth_token = True │ │
│ │ has_token = False │ │
│ │ kwargs = {} │ │
│ │ signature = ~T> │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /home/daniel/miniconda3/envs/blt/lib/python3.12/site-packages/huggingface_hub/hub_mixin.py:566 in from_pretrained │
│ │
│ 563 │ │ │ if cls._hub_mixin_inject_config and "config" not in model_kwargs: ╭──────────────────────── locals ────────────────────────╮ │
│ 564 │ │ │ │ model_kwargs["config"] = config │ cache_dir = None │ │
│ 565 │ │ │ config = None │ │
│ ❱ 566 │ │ instance = cls._from_pretrained( │ config_file = None │ │
│ 567 │ │ │ model_id=str(model_id), │ force_download = False │ │
│ 568 │ │ │ revision=revision, │ local_files_only = False │ │
│ 569 │ │ │ cache_dir=cache_dir, │ model_id = 'facebook/blt-entropy' │ │
│ │ model_kwargs = {} │ │
│ │ pretrained_model_name_or_path = 'facebook/blt-entropy' │ │
│ │ proxies = None │ │
│ │ resume_download = None │ │
│ │ revision = None │ │
│ │ token = None │ │
│ ╰────────────────────────────────────────────────────────╯ │
│ │
│ /home/daniel/miniconda3/envs/blt/lib/python3.12/site-packages/huggingface_hub/hub_mixin.py:789 in _from_pretrained │
│ │
│ 786 │ │ **model_kwargs, ╭───────────────── locals ──────────────────╮ │
│ 787 │ ): │ cache_dir = None │ │
│ 788 │ │ """Load Pytorch pretrained weights and return the loaded model.""" │ force_download = False │ │
│ ❱ 789 │ │ model = cls(**model_kwargs) │ local_files_only = False │ │
│ 790 │ │ if os.path.isdir(model_id): │ map_location = 'cpu' │ │
│ 791 │ │ │ print("Loading weights from local directory") │ model_id = 'facebook/blt-entropy' │ │
│ 792 │ │ │ model_file = os.path.join(model_id, constants.SAFETENSORS_SINGLE_FILE) │ model_kwargs = {} │ │
│ │ proxies = None │ │
│ │ resume_download = None │ │
│ │ revision = None │ │
│ │ strict = False │ │
│ │ token = None │ │
│ ╰───────────────────────────────────────────╯ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: LMTransformer.__init__() missing 1 required positional argument: 'args'
```
Contributor guide
Research direction
Start by reproducing the command shown in the issue, then inspect load_transformers in bytelatent/hf.py at the LMTransformer.from_pretrained call on line 155. Trace how the entropy model is loaded and identify why the required args argument is missing; done means the command loads the entropy model without this exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- huggingface, python
- Domain
- backend, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100