In the run_ner.py example, give the optional label arg a default value (#5326)
Otherwise, if label is not specified, the following error occurs: Traceback (most recent call last): File "run_ner.py", line 303, in <module> main() File "run_ner.py", line 101, in main model_args, data_args, training_args = parser.parse_json_file(json_file=os.path.abspath(sys.argv[1])) File "/home/user/anaconda3/envs/bert/lib/python3.7/site-packages/transformers/hf_argparser.py", line 159, in parse_json_file obj = dtype(**inputs) TypeError: __init__() missing 1 required positional argument: 'labels'
This commit is contained in:
@@ -75,7 +75,8 @@ class DataTrainingArguments:
|
||||
metadata={"help": "The input data dir. Should contain the .txt files for a CoNLL-2003-formatted task."}
|
||||
)
|
||||
labels: Optional[str] = field(
|
||||
metadata={"help": "Path to a file containing all labels. If not specified, CoNLL-2003 labels are used."}
|
||||
default=None,
|
||||
metadata={"help": "Path to a file containing all labels. If not specified, CoNLL-2003 labels are used."},
|
||||
)
|
||||
max_seq_length: int = field(
|
||||
default=128,
|
||||
|
||||
Reference in New Issue
Block a user