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
b1c8b769
Unverified
Commit
b1c8b769
authored
Jul 28, 2020
by
Joe Davison
Committed by
GitHub
Jul 28, 2020
Browse files
Fix zero-shot pipeline single seq output shape (#6104)
parent
06834bc3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/pipelines.py
src/transformers/pipelines.py
+1
-1
No files found.
src/transformers/pipelines.py
View file @
b1c8b769
...
@@ -959,7 +959,7 @@ class ZeroShotClassificationPipeline(Pipeline):
...
@@ -959,7 +959,7 @@ class ZeroShotClassificationPipeline(Pipeline):
top_inds
=
list
(
reversed
(
scores
[
iseq
].
argsort
()))
top_inds
=
list
(
reversed
(
scores
[
iseq
].
argsort
()))
result
.
append
(
result
.
append
(
{
{
"sequence"
:
sequences
if
num_
sequences
==
1
else
sequences
[
iseq
],
"sequence"
:
sequences
if
isinstance
(
sequences
,
str
)
else
sequences
[
iseq
],
"labels"
:
[
candidate_labels
[
i
]
for
i
in
top_inds
],
"labels"
:
[
candidate_labels
[
i
]
for
i
in
top_inds
],
"scores"
:
scores
[
iseq
][
top_inds
].
tolist
(),
"scores"
:
scores
[
iseq
][
top_inds
].
tolist
(),
}
}
...
...
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