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
ce6add8e
Unverified
Commit
ce6add8e
authored
Aug 30, 2021
by
Nathan Raw
Committed by
GitHub
Aug 30, 2021
Browse files
🐛
fix small model card bugs (#13310)
*
🐛
fix small model card bugs *
💄
style
parent
139e8301
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/transformers/modelcard.py
src/transformers/modelcard.py
+9
-6
No files found.
src/transformers/modelcard.py
View file @
ce6add8e
...
@@ -426,12 +426,15 @@ class TrainingSummary:
...
@@ -426,12 +426,15 @@ class TrainingSummary:
result
[
"dataset"
][
"args"
]
=
dataset_arg_mapping
[
ds_tag
]
result
[
"dataset"
][
"args"
]
=
dataset_arg_mapping
[
ds_tag
]
if
len
(
metric_mapping
)
>
0
:
if
len
(
metric_mapping
)
>
0
:
result
[
"metrics"
]
=
[]
for
metric_tag
,
metric_name
in
metric_mapping
.
items
():
for
metric_tag
,
metric_name
in
metric_mapping
.
items
():
result
[
"metric"
]
=
{
result
[
"metrics"
].
append
(
"name"
:
metric_name
,
{
"type"
:
metric_tag
,
"name"
:
metric_name
,
"value"
:
self
.
eval_results
[
metric_name
],
"type"
:
metric_tag
,
}
"value"
:
self
.
eval_results
[
metric_name
],
}
)
model_index
[
"results"
].
append
(
result
)
model_index
[
"results"
].
append
(
result
)
...
@@ -446,7 +449,7 @@ class TrainingSummary:
...
@@ -446,7 +449,7 @@ class TrainingSummary:
metadata
=
_insert_values_as_list
(
metadata
,
"tags"
,
self
.
tags
)
metadata
=
_insert_values_as_list
(
metadata
,
"tags"
,
self
.
tags
)
metadata
=
_insert_values_as_list
(
metadata
,
"datasets"
,
self
.
dataset_tags
)
metadata
=
_insert_values_as_list
(
metadata
,
"datasets"
,
self
.
dataset_tags
)
metadata
=
_insert_values_as_list
(
metadata
,
"metrics"
,
list
(
metric_mapping
.
keys
()))
metadata
=
_insert_values_as_list
(
metadata
,
"metrics"
,
list
(
metric_mapping
.
keys
()))
metadata
[
"model
_
index"
]
=
self
.
create_model_index
(
metric_mapping
)
metadata
[
"model
-
index"
]
=
self
.
create_model_index
(
metric_mapping
)
return
metadata
return
metadata
...
...
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