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
ee29871f
"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "1d7dfc07d5e76968c9137c17fca0f7ad77a7b9d8"
Commit
ee29871f
authored
Nov 02, 2018
by
VictorSanh
Browse files
Debug run_squad_pytorch
parent
101eabff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
run_squad_pytorch.py
run_squad_pytorch.py
+15
-5
No files found.
run_squad_pytorch.py
View file @
ee29871f
...
@@ -909,11 +909,21 @@ def main():
...
@@ -909,11 +909,21 @@ def main():
start_logits
=
[
x
.
view
(
-
1
).
detach
().
cpu
().
numpy
()
for
x
in
start_logits
]
start_logits
=
[
x
.
view
(
-
1
).
detach
().
cpu
().
numpy
()
for
x
in
start_logits
]
#end_logits = [x.item() for x in end_logits]
#end_logits = [x.item() for x in end_logits]
end_logits
=
[
x
.
view
(
-
1
).
detach
().
cpu
().
numpy
()
for
x
in
end_logits
]
end_logits
=
[
x
.
view
(
-
1
).
detach
().
cpu
().
numpy
()
for
x
in
end_logits
]
all_results
.
append
(
for
idx
,
i
in
enumerate
(
unique_id
):
RawResult
(
s
=
start_logits
[
idx
]
unique_id
=
unique_id
,
e
=
end_logits
[
idx
]
start_logits
=
start_logits
,
all_results
.
append
(
end_logits
=
end_logits
))
RawResult
(
unique_id
=
i
,
start_logits
=
s
,
end_logits
=
e
)
)
# all_results.append(
# RawResult(
# unique_id=unique_id,
# start_logits=start_logits,
# end_logits=end_logits))
output_prediction_file
=
os
.
path
.
join
(
args
.
output_dir
,
"predictions.json"
)
output_prediction_file
=
os
.
path
.
join
(
args
.
output_dir
,
"predictions.json"
)
output_nbest_file
=
os
.
path
.
join
(
args
.
output_dir
,
"nbest_predictions.json"
)
output_nbest_file
=
os
.
path
.
join
(
args
.
output_dir
,
"nbest_predictions.json"
)
...
...
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