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
9dc78257
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "f26099e7b5cf579f99a42bab6ddd371bf2c8d548"
Unverified
Commit
9dc78257
authored
Feb 25, 2021
by
abhishek thakur
Committed by
GitHub
Feb 25, 2021
Browse files
Remove unused variable in example for Q&A (#10392)
parent
894db670
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
2 deletions
+0
-2
docs/source/task_summary.rst
docs/source/task_summary.rst
+0
-2
No files found.
docs/source/task_summary.rst
View file @
9dc78257
...
@@ -240,7 +240,6 @@ Here is an example of question answering using a model and a tokenizer. The proc
...
@@ -240,7 +240,6 @@ Here is an example of question answering using a model and a tokenizer. The proc
...
inputs
=
tokenizer
(
question
,
text
,
add_special_tokens
=
True
,
return_tensors
=
"pt"
)
...
inputs
=
tokenizer
(
question
,
text
,
add_special_tokens
=
True
,
return_tensors
=
"pt"
)
...
input_ids
=
inputs
[
"input_ids"
].
tolist
()[
0
]
...
input_ids
=
inputs
[
"input_ids"
].
tolist
()[
0
]
...
...
...
text_tokens
=
tokenizer
.
convert_ids_to_tokens
(
input_ids
)
...
outputs
=
model
(**
inputs
)
...
outputs
=
model
(**
inputs
)
...
answer_start_scores
=
outputs
.
start_logits
...
answer_start_scores
=
outputs
.
start_logits
...
answer_end_scores
=
outputs
.
end_logits
...
answer_end_scores
=
outputs
.
end_logits
...
@@ -284,7 +283,6 @@ Here is an example of question answering using a model and a tokenizer. The proc
...
@@ -284,7 +283,6 @@ Here is an example of question answering using a model and a tokenizer. The proc
...
inputs
=
tokenizer
(
question
,
text
,
add_special_tokens
=
True
,
return_tensors
=
"tf"
)
...
inputs
=
tokenizer
(
question
,
text
,
add_special_tokens
=
True
,
return_tensors
=
"tf"
)
...
input_ids
=
inputs
[
"input_ids"
].
numpy
()[
0
]
...
input_ids
=
inputs
[
"input_ids"
].
numpy
()[
0
]
...
...
...
text_tokens
=
tokenizer
.
convert_ids_to_tokens
(
input_ids
)
...
outputs
=
model
(
inputs
)
...
outputs
=
model
(
inputs
)
...
answer_start_scores
=
outputs
.
start_logits
...
answer_start_scores
=
outputs
.
start_logits
...
answer_end_scores
=
outputs
.
end_logits
...
answer_end_scores
=
outputs
.
end_logits
...
...
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