Fixed annoying bug that caused it to not work right-of-the-bat

#15
AI4Bharat org

AttributeError: 'Gemma3PunctuationConfig' object has no attribute 'layer_types'

Root cause: the remote Gemma3PunctuationConfig subclass was still deriving from bare PretrainedConfig and set self.num_labels before the base initializer ran, so id2label/label2id never got populated. Later, Gemma3ForTokenClassification also expected all of the Gemma3TextConfig attributes (e.g. layer_types), which the class never provided.
Fix: make the config inherit from Gemma3TextConfig, call its initializer first, and only then set the punctuation-specific fields plus num_labels.

AshwinSankar changed pull request status to merged

Sign up or log in to comment