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
50ee5957
Commit
50ee5957
authored
Jan 06, 2020
by
thomwolf
Browse files
update formating - make flake8 happy
parent
1c933358
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
examples/hans/test_hans.py
examples/hans/test_hans.py
+3
-8
examples/hans/utils_hans.py
examples/hans/utils_hans.py
+0
-3
No files found.
examples/hans/test_hans.py
View file @
50ee5957
...
...
@@ -19,7 +19,6 @@ from __future__ import absolute_import, division, print_function
import
argparse
import
glob
import
json
import
logging
import
os
import
random
...
...
@@ -56,18 +55,14 @@ from transformers import (
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
(
...
...
@@ -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
,
...
...
@@ -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"
)
...
...
examples/hans/utils_hans.py
View file @
50ee5957
...
...
@@ -17,7 +17,6 @@
import
copy
import
csv
import
json
import
sys
class
InputExample
(
object
):
...
...
@@ -118,7 +117,5 @@ class DataProcessor(object):
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
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