-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Doctest longformer #16441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doctest longformer #16441
Changes from 8 commits
1f14e25
996d032
b240fba
c4b9a25
9c811f7
3926af7
34809da
2da3790
ca8f6dc
c53fcc2
2858d81
f5f5040
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2079,10 +2079,12 @@ def get_prefix_bias_name(self): | |
@add_start_docstrings_to_model_forward(LONGFORMER_INPUTS_DOCSTRING.format("batch_size, sequence_length")) | ||
@add_code_sample_docstrings( | ||
processor_class=_TOKENIZER_FOR_DOC, | ||
checkpoint=_CHECKPOINT_FOR_DOC, | ||
checkpoint="saibo/legal-longformer-base-4096", | ||
output_type=TFLongformerMaskedLMOutput, | ||
config_class=_CONFIG_FOR_DOC, | ||
mask="<mask>", | ||
expected_output="' no'", | ||
expected_loss=4.5, | ||
) | ||
def call( | ||
self, | ||
|
@@ -2175,6 +2177,8 @@ def __init__(self, config, *inputs, **kwargs): | |
checkpoint="allenai/longformer-large-4096-finetuned-triviaqa", | ||
output_type=TFLongformerQuestionAnsweringModelOutput, | ||
config_class=_CONFIG_FOR_DOC, | ||
expected_output="' puppet'", | ||
expected_loss=0.96, | ||
) | ||
def call( | ||
self, | ||
|
@@ -2321,6 +2325,8 @@ def __init__(self, config, *inputs, **kwargs): | |
checkpoint=_CHECKPOINT_FOR_DOC, | ||
output_type=TFLongformerSequenceClassifierOutput, | ||
config_class=_CONFIG_FOR_DOC, | ||
expected_output="LABEL_0", | ||
expected_loss=0.58, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the checkpoint There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct! |
||
) | ||
def call( | ||
self, | ||
|
@@ -2559,6 +2565,8 @@ def __init__(self, config, *inputs, **kwargs): | |
checkpoint=_CHECKPOINT_FOR_DOC, | ||
output_type=TFLongformerTokenClassifierOutput, | ||
config_class=_CONFIG_FOR_DOC, | ||
expected_output="['LABEL_0', 'LABEL_0', 'LABEL_0', 'LABEL_0', 'LABEL_0', 'LABEL_0', 'LABEL_1', 'LABEL_1', 'LABEL_0', 'LABEL_0', 'LABEL_0', 'LABEL_0']", | ||
expected_loss=0.62, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as I give for sequence classification model. |
||
) | ||
def call( | ||
self, | ||
|
Uh oh!
There was an error while loading. Please reload this page.