Skip to content

Commit

Permalink
Merge pull request #123 from stanfordnlp/zen/unseenmodel
Browse files Browse the repository at this point in the history
[P0] Fix unseen model type support
  • Loading branch information
frankaging authored Mar 3, 2024
2 parents 35a3433 + c3c9d5c commit 9798caf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyvene/models/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ def output_to_subcomponent(output, component, model_type, model_config):
:param model_config: Hugging Face Model Config
"""
subcomponent = output
if component in type_to_module_mapping[model_type]:
if model_type in type_to_module_mapping and \
component in type_to_module_mapping[model_type]:
split_last_dim_by = type_to_module_mapping[model_type][component][2:]
if len(split_last_dim_by) != 0 and len(split_last_dim_by) > 2:
raise ValueError(f"Unsupported {split_last_dim_by}.")
Expand Down

0 comments on commit 9798caf

Please sign in to comment.