Skip to content

Commit

Permalink
update formating - make flake8 happy
Browse files Browse the repository at this point in the history
  • Loading branch information
thomwolf committed Jan 16, 2020
1 parent 1c93335 commit 50ee595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 3 additions & 8 deletions examples/hans/test_hans.py
Expand Up @@ -19,7 +19,6 @@

import argparse
import glob
import json
import logging
import os
import random
Expand Down Expand Up @@ -56,18 +55,14 @@
XLNetTokenizer,
get_linear_schedule_with_warmup,
)
from transformers import glue_compute_metrics as compute_metrics


try:
from torch.utils.tensorboard import SummaryWriter
except:
except ImportError:
from tensorboardX import SummaryWriter





logger = logging.getLogger(__name__)

ALL_MODELS = sum(
Expand Down Expand Up @@ -374,7 +369,7 @@ def load_and_cache_examples(args, task, tokenizer, evaluate=False):
def main():
parser = argparse.ArgumentParser()

## Required parameters
# Required parameters
parser.add_argument(
"--data_dir",
default=None,
Expand Down Expand Up @@ -411,7 +406,7 @@ def main():
help="The output directory where the model predictions and checkpoints will be written.",
)

## Other parameters
# Other parameters
parser.add_argument(
"--config_name", default="", type=str, help="Pretrained config name or path if not the same as model_name"
)
Expand Down
3 changes: 0 additions & 3 deletions examples/hans/utils_hans.py
Expand Up @@ -17,7 +17,6 @@
import copy
import csv
import json
import sys


class InputExample(object):
Expand Down Expand Up @@ -118,7 +117,5 @@ def _read_tsv(cls, input_file, quotechar=None):
reader = csv.reader(f, delimiter="\t", quotechar=quotechar)
lines = []
for line in reader:
if sys.version_info[0] == 2:
line = list(unicode(cell, "utf-8") for cell in line)
lines.append(line)
return lines

0 comments on commit 50ee595

Please sign in to comment.