Skip to content

Add table-transformer to NormalizedConfigManager - #2511

Open
kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:add-table-transformer-normalized-config
Open

kratos0718 wants to merge 1 commit into
huggingface:mainfrom
kratos0718:add-table-transformer-normalized-config

Conversation

@kratos0718

Copy link
Copy Markdown

Summary

Part of #351. table-transformer already has an ONNX export config but was missing from NormalizedConfigManager, so ORTOptimizer can't run on it yet.

  • Added "table-transformer": NormalizedTextConfig to _conf (alphabetically, between splinter and t5)
  • Removed table-transformer from the TODO: missing normalized configs comment above it

Same situation as DETR (#2510, also open on this issue): table-transformer is DETR-based, so its config stores transformer stats under d_model/encoder_attention_heads/encoder_layers, but TableTransformerConfig.attribute_map already aliases these to hidden_size/num_attention_heads/num_hidden_layers, so plain NormalizedTextConfig resolves them with no custom with_args(...) mapping needed.

Test plan

  • Added two tests to tests/utils/test_normalized_config.py: one confirming table-transformer resolves to NormalizedTextConfig, and one instantiating a real TableTransformerConfig() and asserting the normalized hidden_size/num_attention_heads/num_layers match d_model/encoder_attention_heads/encoder_layers
  • Ran both locally against the actual transformers.TableTransformerConfig (not mocked) — both pass

table-transformer has an ONNX export config but was missing from
NormalizedConfigManager. Same situation as DETR (it's DETR-based): the
config exposes hidden_size, num_attention_heads and num_hidden_layers
through its own attribute_map, so plain NormalizedTextConfig resolves them
with no custom optimum-side mapping needed.
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