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
57820456
Unverified
Commit
57820456
authored
Jan 20, 2022
by
Matt
Committed by
GitHub
Jan 20, 2022
Browse files
Fix crash when logs are empty because Keras has wiped them out of spite (#15258)
parent
1fc0fa46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/modelcard.py
src/transformers/modelcard.py
+3
-0
No files found.
src/transformers/modelcard.py
View file @
57820456
...
...
@@ -706,6 +706,9 @@ def parse_keras_history(logs):
"""
if
hasattr
(
logs
,
"history"
):
# This looks like a `History` object
if
not
hasattr
(
logs
,
"epoch"
):
# This history looks empty, return empty results
return
None
,
[],
dict
()
logs
.
history
[
"epoch"
]
=
logs
.
epoch
logs
=
logs
.
history
else
:
...
...
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