mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
add comment for example_index and unique_id in single process
This commit is contained in:
parent
3c6efd0ca3
commit
d000195ee6
@ -225,7 +225,7 @@ def squad_convert_example_to_features(example, max_seq_length,
|
||||
span['token_type_ids'],
|
||||
cls_index,
|
||||
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,
|
||||
paragraph_len=span['paragraph_len'],
|
||||
token_is_max_context=span["token_is_max_context"],
|
||||
|
@ -592,8 +592,8 @@ class RobertaForQuestionAnswering(BertPreTrainedModel):
|
||||
start_scores, end_scores = model(torch.tensor([input_ids]))
|
||||
all_tokens = tokenizer.convert_ids_to_tokens(input_ids)
|
||||
print(' '.join(all_tokens[torch.argmax(start_scores) : torch.argmax(end_scores)+1]))
|
||||
# a nice puppet
|
||||
# Note: 'roberta-large' model can not produce the right answer above. Waiting for 'roberta-large-finetuned-squad'
|
||||
a nice puppet
|
||||
Note: 'roberta-large' model can not produce the right answer above. Waiting for 'roberta-large-finetuned-squad'
|
||||
to be uploaded.
|
||||
"""
|
||||
config_class = RobertaConfig
|
||||
|
Loading…
Reference in New Issue
Block a user