facebookresearch / TaBERT

This repository contains source code for the TaBERT model, a pre-trained language model for learning joint representations of natural language utterances and (semi-)structured tables for semantic parsing. TaBERT is pre-trained on a massive corpus of 26M Web tables and their associated natural language context, and could be used as a drop-in replacement of a semantic parsers original encoder to compute representations for utterances and table schemas (columns).
Other
580 stars 63 forks source link

Load a pretrained model giving error #11

Open Vincentchhsu opened 3 years ago

Vincentchhsu commented 3 years ago

Hi, when i use TableBertModel.from_pretrained to load a model (/tabert_base_k1/model.bin) but it return below error :

Traceback (most recent call last):
  File "tabert.py", line 1, in <module>
    from table_bert import TableBertModel
  File "/var/Project/SmartSearch/TableQA/TaBERT-master/table_bert/__init__.py", line 8, in <module>
    from table_bert.config import TableBertConfig
  File "/var/Project/SmartSearch/TableQA/TaBERT-master/table_bert/config.py", line 34, in <module>
    type_vocab_size=2,
TypeError: __init__() got an unexpected keyword argument 'layer_norm_eps'

would you please tell me how to solve this problem? thanks.

ghost commented 3 years ago

I met the same error when I installed the packagepytorch-pretrained-bert directly from pip.

Try reinstalling the package using pip install --editable=git+https://github.com/huggingface/transformers.git@372a5c1ceec49b52c503707e9657bfaae7c236a0#egg=pytorch_pretrained_bert