Skip to content

convert : add text_config as fallback [transformers 5.18] - #30040

Merged
CISC merged 2 commits into
ggml-org:masterfrom
frozenblade1224:convert-fix
Oct 6, 2026
Merged

CISC merged 2 commits into
ggml-org:masterfrom
frozenblade1224:convert-fix

Conversation

@frozenblade1224

Copy link
Copy Markdown
Contributor

Overview

Transformers 5.18 maps llm_config to text_config, which consumes the original field. Hence, the fields that are expected to be found under llm_config are absent and we run into the following error -

KeyError: "could not find any of: ['n_layers', 'num_hidden_layers', 'n_layer', 'num_layers', 'mamba_n_layers', 'mamba_num_hidden_layers', 'mamba_n_layer', 'mamba_num_layers']"

This PR resolves that by adding text_config as a fallback if llm_config is not found. This should not disturb any current working and add 5.18 compatibility.

Requirements

@CISC CISC left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a hold-over, load_hparams consolidates all variants into text_config.

Comment thread conversion/nemotron.py Resolved
Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
@CISC
CISC merged commit 6c73b3e into ggml-org:master Oct 6, 2026
5 checks passed
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 8, 2026
…0040)

* add text_config as fallback

* remove redundant llm_config check

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
(cherry picked from commit 6c73b3e)
@frozenblade1224
frozenblade1224 deleted the convert-fix branch October 11, 2026 06:23
edwardyoon pushed a commit to edwardyoon/focus-llama that referenced this pull request Oct 24, 2026
…0040)

* add text_config as fallback

* remove redundant llm_config check

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
auRose94 pushed a commit to auRose94/llama.cpp that referenced this pull request Oct 28, 2026
…0040)

* add text_config as fallback

* remove redundant llm_config check

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>

---------

Co-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants