"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "dbd041243d3c6827ae3dfad5e53619ee7838853c"
Commit d000195e authored by erenup's avatar erenup
Browse files

add comment for example_index and unique_id in single process

parent 3c6efd0c
...@@ -225,7 +225,7 @@ def squad_convert_example_to_features(example, max_seq_length, ...@@ -225,7 +225,7 @@ def squad_convert_example_to_features(example, max_seq_length,
span['token_type_ids'], span['token_type_ids'],
cls_index, cls_index,
p_mask.tolist(), p_mask.tolist(),
example_index=0, example_index=0, # Can not set unique_id and example_index here. They will be set after multiple processing.
unique_id=0, unique_id=0,
paragraph_len=span['paragraph_len'], paragraph_len=span['paragraph_len'],
token_is_max_context=span["token_is_max_context"], token_is_max_context=span["token_is_max_context"],
......
...@@ -592,8 +592,8 @@ class RobertaForQuestionAnswering(BertPreTrainedModel): ...@@ -592,8 +592,8 @@ class RobertaForQuestionAnswering(BertPreTrainedModel):
start_scores, end_scores = model(torch.tensor([input_ids])) start_scores, end_scores = model(torch.tensor([input_ids]))
all_tokens = tokenizer.convert_ids_to_tokens(input_ids) all_tokens = tokenizer.convert_ids_to_tokens(input_ids)
print(' '.join(all_tokens[torch.argmax(start_scores) : torch.argmax(end_scores)+1])) print(' '.join(all_tokens[torch.argmax(start_scores) : torch.argmax(end_scores)+1]))
# a nice puppet a nice puppet
# Note: 'roberta-large' model can not produce the right answer above. Waiting for 'roberta-large-finetuned-squad' Note: 'roberta-large' model can not produce the right answer above. Waiting for 'roberta-large-finetuned-squad'
to be uploaded. to be uploaded.
""" """
config_class = RobertaConfig config_class = RobertaConfig
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment