Commit Graph

15053 Commits

Author SHA1 Message Date
Thomas Wolf
c18bdb4433
Merge pull request #124 from deepset-ai/master
Add example for fine tuning BERT language model
2019-01-07 12:03:51 +01:00
Li Dong
d0d9b384f2
LayerNorm initialization
The LayerNorm gamma and beta should be initialized by .fill_(1.0) and .zero_().

reference links:

989e78c412/tensorflow/contrib/layers/python/layers/layers.py (L2298)

989e78c412/tensorflow/contrib/layers/python/layers/layers.py (L2308)
2019-01-07 15:51:33 +08:00
Sang-Kil Park
ca4e7aaa72
Fix error when bert_model param is path or url.
Error occurs when `bert_model` param is path or url. Therefore, if it is path, specify the last path to prevent error.
2019-01-05 11:42:54 +09:00
Jade Abbott
193e2df8ba Remove rogue comment 2019-01-03 13:13:06 +02:00
Jade Abbott
c64de50ea4 nb_tr_steps is not initialized 2019-01-03 12:34:57 +02:00
Jade Abbott
b96149a19b Training loss is not initialized if only do_eval is specified 2019-01-03 10:32:10 +02:00
Jade Abbott
be3b9bcf4d Allow one to use the pretrained model in evaluation when do_train is not selected 2019-01-03 09:02:33 +02:00
Grégory Châtel
186f75342e Adding new pretrained model to the help of the bert_model argument. 2019-01-02 14:00:59 +01:00
wlhgtc
e626eecc25
Update modeling.py 2018-12-22 20:26:05 +08:00
Jasdeep Singh
99709ee61d
loading saved model when n_classes != 2
Required to for: Assertion `t >= 0 && t < n_classes` failed,  if your default number of classes is not 2.
2018-12-20 13:55:47 -08:00
Julien Chaumond
8da280ebbe Setup CI 2018-12-20 16:33:39 -05:00
tholor
e5fc98c542 add exemplary training data. update to nvidia apex. refactor 'item -> line in doc' mapping. add warning for unknown word. 2018-12-20 18:30:52 +01:00
Grégory Châtel
7176674849 Fixing various class documentations. 2018-12-20 13:11:17 +01:00
Thomas Wolf
7fb94ab934
Merge pull request #127 from patrick-s-h-lewis/tokenizer-error-on-long-seqs
raises value error for bert tokenizer for long sequences
2018-12-19 10:29:17 +01:00
Thomas Wolf
2feb29c0ff
Merge pull request #130 from sodre/use-entry-points
Use entry-points instead of scripts
2018-12-19 10:18:24 +01:00
Thomas Wolf
2c9991496b
Merge pull request #128 from sodre/add-license
Add license to source distribution
2018-12-19 10:15:53 +01:00
tholor
17595ef2de Merge branch 'master' of https://github.com/deepset-ai/pytorch-pretrained-BERT 2018-12-19 09:22:53 +01:00
tholor
67f4dd56a3 update readme for run_lm_finetuning 2018-12-19 09:22:37 +01:00
Patrick Sodré
ecf3ea197e Remove original script 2018-12-19 02:26:08 +00:00
Patrick Sodré
87c1244c7d Convert scripts into entry_points
The recommended approach to create launch scripts is to use entry_points
and console_scripts.

xref: https://packaging.python.org/guides/distributing-packages-using-setuptools/#scripts
2018-12-19 02:26:08 +00:00
Patrick Sodré
b3d86162b0 Add license to source distribution 2018-12-19 01:41:18 +00:00
Julien Chaumond
d57763f582 Fix typos 2018-12-18 19:23:22 -05:00
Patrick Lewis
78cf7b4ab4 added code to raise value error for bert tokenizer for covert_tokens_to_indices 2018-12-18 14:41:30 +00:00
deepset
a58361f197
Add example for fine tuning BERT language model (#1)
Adds an example for loading a pre-trained BERT model and fine tune it as a language model (masked tokens & nextSentence) on your target corpus.
2018-12-18 10:32:25 +01:00
Thomas Wolf
786cc41299
Typos in readme 2018-12-17 09:22:18 +01:00
Thomas Wolf
ecc0b54bec
Merge pull request #119 from danyaljj/patch-1
Minor README fix
2018-12-14 23:29:47 +01:00
Daniel Khashabi
8b1b93947f
Minor fix. 2018-12-14 14:10:36 -05:00
Thomas Wolf
8809eb6c93
update readme with information on NVIDIA's apex 2018-12-14 16:59:39 +01:00
Thomas Wolf
e1bfad4846
Merge pull request #112 from huggingface/fourth-release
Fourth release
2018-12-14 15:15:47 +01:00
thomwolf
d821358884 update readme 2018-12-14 15:15:17 +01:00
thomwolf
37378898a2 adding DockerFile 2018-12-14 15:02:32 +01:00
thomwolf
4a4b0e5783 remove logging. basicConfig from library code 2018-12-14 14:46:25 +01:00
thomwolf
ae88eb88a4 set encoding to 'utf-8' in calls to open 2018-12-14 13:48:58 +01:00
thomwolf
e1eab59aac no fp16 on evaluation 2018-12-13 14:54:02 +01:00
thomwolf
087798b7fa fix reloading model for evaluation in examples 2018-12-13 14:48:12 +01:00
thomwolf
0f544625f4 fix swag example for work with apex 2018-12-13 13:35:59 +01:00
thomwolf
0cf88ff084 make examples work without apex 2018-12-13 13:28:00 +01:00
thomwolf
52c53f39d0 clean up apex integration 2018-12-13 13:02:17 +01:00
thomwolf
4946c2c500 run_swag example in readme 2018-12-13 13:02:07 +01:00
thomwolf
d23eed85bb model loading apex modification 2018-12-13 12:53:17 +01:00
thomwolf
1cbb32a542 include version number + comment in setup.py 2018-12-13 12:50:44 +01:00
thomwolf
ce52177638 added version in __init__.py 2018-12-13 12:50:44 +01:00
thomwolf
d3fcec1a3e add saving and loading model in examples 2018-12-13 12:50:44 +01:00
thomwolf
93f335ef86 add pretrained loading from state_dict 2018-12-13 12:48:13 +01:00
thomwolf
b3caec5a56 adding save checkpoint and loading in examples 2018-12-13 12:48:13 +01:00
thomwolf
85fff78c2d compatibility PT 1.0 and 0.4.1 2018-12-13 12:48:13 +01:00
thomwolf
13bf0d4659 fixing Adam weights skip in TF convert script 2018-12-13 12:48:13 +01:00
Thomas Wolf
91aab2a6d3
Merge pull request #116 from FDecaYed/deyuf/fp16_with_apex
Change to use apex for better fp16 and multi-gpu support
2018-12-13 12:32:37 +01:00
Thomas Wolf
32a227f507
Merge pull request #113 from hzhwcmhf/master
fix compatibility with python 3.5.2
2018-12-13 12:15:15 +01:00
Thomas Wolf
ffe9075f48
Merge pull request #96 from rodgzilla/multiple-choice-code
BertForMultipleChoice and Swag dataset example.
2018-12-13 12:05:11 +01:00