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
6b0da96b
"...git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "70be7d0fa5194552298380deef0078c385a32b28"
Commit
6b0da96b
authored
Nov 04, 2018
by
thomwolf
Browse files
clean up
parent
834b485b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
run_classifier.py
run_classifier.py
+13
-10
run_squad.py
run_squad.py
+2
-2
No files found.
run_classifier.py
View file @
6b0da96b
...
@@ -192,8 +192,7 @@ class ColaProcessor(DataProcessor):
...
@@ -192,8 +192,7 @@ class ColaProcessor(DataProcessor):
return
examples
return
examples
def
convert_examples_to_features
(
examples
,
label_list
,
max_seq_length
,
def
convert_examples_to_features
(
examples
,
label_list
,
max_seq_length
,
tokenizer
):
tokenizer
):
"""Loads a data file into a list of `InputBatch`s."""
"""Loads a data file into a list of `InputBatch`s."""
label_map
=
{}
label_map
=
{}
...
@@ -380,7 +379,7 @@ def main():
...
@@ -380,7 +379,7 @@ def main():
parser
.
add_argument
(
"--do_lower_case"
,
parser
.
add_argument
(
"--do_lower_case"
,
default
=
False
,
default
=
False
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
"Whether to lower case the input text.
Should be
True for uncased models
and
False for cased models."
)
help
=
"Whether to lower case the input text. True for uncased models
,
False for cased models."
)
parser
.
add_argument
(
"--max_seq_length"
,
parser
.
add_argument
(
"--max_seq_length"
,
default
=
128
,
default
=
128
,
type
=
int
,
type
=
int
,
...
@@ -424,6 +423,10 @@ def main():
...
@@ -424,6 +423,10 @@ def main():
default
=
False
,
default
=
False
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
"Whether not to use CUDA when available"
)
help
=
"Whether not to use CUDA when available"
)
parser
.
add_argument
(
"--accumulate_gradients"
,
type
=
int
,
default
=
1
,
help
=
"Number of steps to accumulate gradient on (divide the single step batch_size)"
)
parser
.
add_argument
(
"--local_rank"
,
parser
.
add_argument
(
"--local_rank"
,
type
=
int
,
type
=
int
,
default
=-
1
,
default
=-
1
,
...
...
run_squad.py
View file @
6b0da96b
...
@@ -18,15 +18,15 @@ from __future__ import absolute_import
...
@@ -18,15 +18,15 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
import
six
import
argparse
import
argparse
import
collections
import
collections
import
logging
import
logging
import
json
import
json
import
math
import
math
import
os
import
os
from
tqdm
import
tqdm
,
trange
import
six
import
random
import
random
from
tqdm
import
tqdm
,
trange
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
...
...
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