Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
32e1332a
Commit
32e1332a
authored
Sep 11, 2019
by
VictorSanh
Browse files
[distil] fix once for all general logger for scripts
parent
b62abe87
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
examples/distillation/scripts/binarized_data.py
examples/distillation/scripts/binarized_data.py
+6
-2
examples/distillation/scripts/token_counts.py
examples/distillation/scripts/token_counts.py
+5
-1
No files found.
examples/distillation/scripts/binarized_data.py
View file @
32e1332a
...
...
@@ -21,8 +21,12 @@ import random
import
time
import
numpy
as
np
from
pytorch_transformers
import
BertTokenizer
import
logging
from
examples.distillation.utils
import
logger
logging
.
basicConfig
(
format
=
'%(asctime)s - %(levelname)s - %(name)s - %(message)s'
,
datefmt
=
'%m/%d/%Y %H:%M:%S'
,
level
=
logging
.
INFO
)
logger
=
logging
.
getLogger
(
__name__
)
def
main
():
parser
=
argparse
.
ArgumentParser
(
description
=
"Preprocess the data to avoid re-doing it several times by (tokenization + token_to_ids)."
)
...
...
examples/distillation/scripts/token_counts.py
View file @
32e1332a
...
...
@@ -18,8 +18,12 @@ Preprocessing script before training DistilBERT.
from
collections
import
Counter
import
argparse
import
pickle
import
logging
from
examples.distillation.utils
import
logger
logging
.
basicConfig
(
format
=
'%(asctime)s - %(levelname)s - %(name)s - %(message)s'
,
datefmt
=
'%m/%d/%Y %H:%M:%S'
,
level
=
logging
.
INFO
)
logger
=
logging
.
getLogger
(
__name__
)
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
(
description
=
"Token Counts for smoothing the masking probabilities in MLM (cf XLM/word2vec)"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment