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
986dd5c5
Commit
986dd5c5
authored
May 17, 2022
by
Sylvain Gugger
Browse files
Fix style
parent
38ddab10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
src/transformers/models/longformer/modeling_longformer.py
src/transformers/models/longformer/modeling_longformer.py
+4
-1
src/transformers/models/longformer/modeling_tf_longformer.py
src/transformers/models/longformer/modeling_tf_longformer.py
+5
-1
No files found.
src/transformers/models/longformer/modeling_longformer.py
View file @
986dd5c5
...
...
@@ -2140,7 +2140,10 @@ class LongformerForTokenClassification(LongformerPreTrainedModel):
checkpoint
=
"brad1141/Longformer-finetuned-norm"
,
output_type
=
LongformerTokenClassifierOutput
,
config_class
=
_CONFIG_FOR_DOC
,
expected_output
=
"['Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence']"
,
expected_output
=
(
"['Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence', 'Evidence',"
" 'Evidence', 'Evidence', 'Evidence', 'Evidence']"
),
expected_loss
=
0.63
,
)
def
forward
(
...
...
src/transformers/models/longformer/modeling_tf_longformer.py
View file @
986dd5c5
...
...
@@ -2591,7 +2591,11 @@ class TFLongformerForTokenClassification(TFLongformerPreTrainedModel, TFTokenCla
checkpoint
=
"hf-internal-testing/tiny-random-longformer"
,
output_type
=
TFLongformerTokenClassifierOutput
,
config_class
=
_CONFIG_FOR_DOC
,
expected_output
=
"['LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1']"
,
expected_output
=
(
"['LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1',"
" 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1', 'LABEL_1',"
" 'LABEL_1', 'LABEL_1']"
),
expected_loss
=
0.59
,
)
def
call
(
...
...
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