databricks / dbrx

Code examples and resources for DBRX, a large language model developed by Databricks
https://www.databricks.com/
Other
2.47k stars 231 forks source link

I have encountered a problem:LayerNorm.__init__() got an unexpected keyword argument 'bias' #20

Closed gyh123wqe closed 3 months ago

gyh123wqe commented 3 months ago

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained. Traceback (most recent call last): File "/home/roo/train/dbrx-instruct/generate.py", line 39, in model = AutoModelForCausalLM.from_pretrained( File "/home/roo/anaconda3/envs/Meditron/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 558, in from_pretrained return model_class.from_pretrained( File "/home/roo/anaconda3/envs/Meditron/lib/python3.10/site-packages/transformers/modeling_utils.py", line 3404, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/home/roo/.cache/huggingface/modules/transformers_modules/model/modeling_dbrx.py", line 1261, in init self.transformer = DbrxModel(config) File "/home/roo/.cache/huggingface/modules/transformers_modules/model/modeling_dbrx.py", line 1013, in init self.blocks = nn.ModuleList([ File "/home/roo/.cache/huggingface/modules/transformers_modules/model/modeling_dbrx.py", line 1014, in DbrxBlock(config, block_idx) for block_idx in range(config.n_layers) File "/home/roo/.cache/huggingface/modules/transformers_modules/model/modeling_dbrx.py", line 856, in init self.norm_attn_norm = DbrxNormAttentionNorm( File "/home/roo/.cache/huggingface/modules/transformers_modules/model/modeling_dbrx.py", line 642, in init self.norm_1 = nn.LayerNorm(hidden_size, bias=False) TypeError: LayerNorm.init() got an unexpected keyword argument 'bias'

hanlint commented 3 months ago

Hello @gyh123wqe , LayerNorm with bias argument was only introduced in Torch 2.1, could you try upgrading to a more recent version of pytorch?

We will add more details in the README about the minimum torch version.