Skip to content

Commit

Permalink
[distil] fix once for all general logger for scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorSanh committed Sep 11, 2019
1 parent b62abe8 commit 32e1332
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions examples/distillation/scripts/binarized_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@
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).")
Expand Down Expand Up @@ -74,4 +78,4 @@ def main():


if __name__ == "__main__":
main()
main()
6 changes: 5 additions & 1 deletion examples/distillation/scripts/token_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
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)")
Expand Down

0 comments on commit 32e1332

Please sign in to comment.