You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to convert a HuggingFace model to a Penzai model using [llama/mistral/gpt_neox]_from_huggingface_model, the conversion fails with a ValueError when the model configuration contains certain attributes that are not explicitly handled.
The conversion should complete successfully, as missing attributes (e.x. _name_or_path) that are not critical for constructing the penzai model and can be ignored.
Actual Behavior
The conversion fails, raising a ValueError for unexpected missing attributes. For the llama example above:
ValueError: Conversion of a LlamaForCausalLM does not support these configuration attributes: {'pad_token_id': -1, '_name_or_path': 'hf-internal-testing/tiny-random-LlamaForCausalLM'}
Root Cause
In penzai/models/transformer/variants/[llama/mistral/gpt_neox].py, the [llama/mistral/gpt_neox]_from_huggingface_model functions check for unsupported configuration attributes but are missing values like _name_or_path in their lists of handled_or_ignored_attributes.
Suggested Fix
Add missing attributes to the handled_or_ignored_attributes sets in the [llama/mistral/gpt_neox]_from_huggingface_model functions.
The text was updated successfully, but these errors were encountered:
ealt
linked a pull request
Apr 22, 2025
that will
close
this issue
Bug Description
When attempting to convert a HuggingFace model to a Penzai model using
[llama/mistral/gpt_neox]_from_huggingface_model
, the conversion fails with a ValueError when the model configuration contains certain attributes that are not explicitly handled.Steps to Reproduce
(similar for
mistral
andgpt_neox
)Expected Behavior
The conversion should complete successfully, as missing attributes (e.x.
_name_or_path
) that are not critical for constructing the penzai model and can be ignored.Actual Behavior
The conversion fails, raising a ValueError for unexpected missing attributes. For the llama example above:
Root Cause
In
penzai/models/transformer/variants/[llama/mistral/gpt_neox].py
, the[llama/mistral/gpt_neox]_from_huggingface_model
functions check for unsupported configuration attributes but are missing values like_name_or_path
in their lists ofhandled_or_ignored_attributes
.Suggested Fix
Add missing attributes to the
handled_or_ignored_attributes
sets in the[llama/mistral/gpt_neox]_from_huggingface_model
functions.The text was updated successfully, but these errors were encountered: