Skip to content

Add gpt-oss (GptOssForCausalLM) support to model_surgery - #149

Open
eddielebelle wants to merge 1 commit into
AlignmentResearch:mainfrom
eddielebelle:add-gpt-oss-model-surgery
Open

Add gpt-oss (GptOssForCausalLM) support to model_surgery#149
eddielebelle wants to merge 1 commit into
AlignmentResearch:mainfrom
eddielebelle:add-gpt-oss-model-surgery

Conversation

@eddielebelle

Copy link
Copy Markdown

get_final_norm and get_transformer_layers raised NotImplementedError for GptOssForCausalLM. Add branches mapping to base_model.norm and base_model.layers (same shape as Llama/Gemma). get_unembedding_matrix already works via get_output_embeddings().

The GptOssModel import is guarded (try/except) so transformers versions before 4.55, when gpt-oss was added, still import this module cleanly (pyproject pins transformers>=4.38.1); the branches are skipped when the symbol is unavailable.

Adds a mockmodel/gpt-oss-tiny fixture to random_small_model so the existing model_surgery tests cover it.

get_final_norm and get_transformer_layers raised NotImplementedError for
GptOssForCausalLM. Add branches mapping to base_model.norm and
base_model.layers (same shape as Llama/Gemma). get_unembedding_matrix
already works via get_output_embeddings().

The GptOssModel import is guarded (try/except) so transformers versions
before 4.55, when gpt-oss was added, still import this module cleanly
(pyproject pins transformers>=4.38.1); the branches are skipped when the
symbol is unavailable.

Adds a mockmodel/gpt-oss-tiny fixture to random_small_model so the existing
model_surgery tests cover it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant