Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
ff5cdc08
"docs/source/usage/engine_args.rst" did not exist on "d619ae2d19c41d9aa8f68fa0e5e32cc410dc2522"
Unverified
Commit
ff5cdc08
authored
Jun 26, 2021
by
Bhadresh Savani
Committed by
GitHub
Jun 26, 2021
Browse files
replace print with logger (#12368)
parent
9a754594
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
examples/pytorch/question-answering/utils_qa.py
examples/pytorch/question-answering/utils_qa.py
+3
-3
No files found.
examples/pytorch/question-answering/utils_qa.py
View file @
ff5cdc08
...
@@ -413,14 +413,14 @@ def postprocess_qa_predictions_with_beam_search(
...
@@ -413,14 +413,14 @@ def postprocess_qa_predictions_with_beam_search(
output_dir
,
"null_odds.json"
if
prefix
is
None
else
f
"
{
prefix
}
_null_odds.json"
output_dir
,
"null_odds.json"
if
prefix
is
None
else
f
"
{
prefix
}
_null_odds.json"
)
)
print
(
f
"Saving predictions to
{
prediction_file
}
."
)
logger
.
info
(
f
"Saving predictions to
{
prediction_file
}
."
)
with
open
(
prediction_file
,
"w"
)
as
writer
:
with
open
(
prediction_file
,
"w"
)
as
writer
:
writer
.
write
(
json
.
dumps
(
all_predictions
,
indent
=
4
)
+
"
\n
"
)
writer
.
write
(
json
.
dumps
(
all_predictions
,
indent
=
4
)
+
"
\n
"
)
print
(
f
"Saving nbest_preds to
{
nbest_file
}
."
)
logger
.
info
(
f
"Saving nbest_preds to
{
nbest_file
}
."
)
with
open
(
nbest_file
,
"w"
)
as
writer
:
with
open
(
nbest_file
,
"w"
)
as
writer
:
writer
.
write
(
json
.
dumps
(
all_nbest_json
,
indent
=
4
)
+
"
\n
"
)
writer
.
write
(
json
.
dumps
(
all_nbest_json
,
indent
=
4
)
+
"
\n
"
)
if
version_2_with_negative
:
if
version_2_with_negative
:
print
(
f
"Saving null_odds to
{
null_odds_file
}
."
)
logger
.
info
(
f
"Saving null_odds to
{
null_odds_file
}
."
)
with
open
(
null_odds_file
,
"w"
)
as
writer
:
with
open
(
null_odds_file
,
"w"
)
as
writer
:
writer
.
write
(
json
.
dumps
(
scores_diff_json
,
indent
=
4
)
+
"
\n
"
)
writer
.
write
(
json
.
dumps
(
scores_diff_json
,
indent
=
4
)
+
"
\n
"
)
...
...
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