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
3b309818
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "95346e9dcd2724ba8203c61759907fb3a8b737cb"
Unverified
Commit
3b309818
authored
Jan 04, 2023
by
milyiyo
Committed by
GitHub
Jan 04, 2023
Browse files
Refactor the function get_results (#20999)
parent
92645229
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
examples/flax/test_flax_examples.py
examples/flax/test_flax_examples.py
+2
-5
No files found.
examples/flax/test_flax_examples.py
View file @
3b309818
...
...
@@ -60,14 +60,11 @@ def get_setup_file():
def
get_results
(
output_dir
,
split
=
"eval"
):
results
=
{}
path
=
os
.
path
.
join
(
output_dir
,
f
"
{
split
}
_results.json"
)
if
os
.
path
.
exists
(
path
):
with
open
(
path
,
"r"
)
as
f
:
results
=
json
.
load
(
f
)
else
:
raise
ValueError
(
f
"can't find
{
path
}
"
)
return
results
return
json
.
load
(
f
)
raise
ValueError
(
f
"can't find
{
path
}
"
)
stream_handler
=
logging
.
StreamHandler
(
sys
.
stdout
)
...
...
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