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
a3cdff41
Unverified
Commit
a3cdff41
authored
May 24, 2024
by
Yih-Dar
Committed by
GitHub
May 24, 2024
Browse files
save the list of new model failures (#31013)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
658b849a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
utils/notification_service.py
utils/notification_service.py
+10
-1
No files found.
utils/notification_service.py
View file @
a3cdff41
...
@@ -636,7 +636,7 @@ class Message:
...
@@ -636,7 +636,7 @@ class Message:
{
"type"
:
"section"
,
"text"
:
{
"type"
:
"mrkdwn"
,
"text"
:
failure_text
}},
{
"type"
:
"section"
,
"text"
:
{
"type"
:
"mrkdwn"
,
"text"
:
failure_text
}},
]
]
def
get_new_model_failure_blocks
(
self
,
with_header
=
True
):
def
get_new_model_failure_blocks
(
self
,
with_header
=
True
,
to_truncate
=
True
):
if
self
.
prev_ci_artifacts
is
None
:
if
self
.
prev_ci_artifacts
is
None
:
return
{}
return
{}
...
@@ -675,6 +675,8 @@ class Message:
...
@@ -675,6 +675,8 @@ class Message:
all_failure_lines
[
new_text
].
append
(
f
"<
{
url
}
|
{
device
}
>"
if
url
is
not
None
else
device
)
all_failure_lines
[
new_text
].
append
(
f
"<
{
url
}
|
{
device
}
>"
if
url
is
not
None
else
device
)
MAX_ERROR_TEXT
=
3000
-
len
(
"[Truncated]"
)
-
len
(
"```New model failures```
\n\n
"
)
MAX_ERROR_TEXT
=
3000
-
len
(
"[Truncated]"
)
-
len
(
"```New model failures```
\n\n
"
)
if
not
to_truncate
:
MAX_ERROR_TEXT
=
float
(
"inf"
)
failure_text
=
""
failure_text
=
""
for
line
,
devices
in
all_failure_lines
.
items
():
for
line
,
devices
in
all_failure_lines
.
items
():
new_text
=
failure_text
+
f
"
{
'|'
.
join
(
devices
)
}
gpu
\n
{
line
}
"
new_text
=
failure_text
+
f
"
{
'|'
.
join
(
devices
)
}
gpu
\n
{
line
}
"
...
@@ -760,6 +762,13 @@ class Message:
...
@@ -760,6 +762,13 @@ class Message:
time
.
sleep
(
1
)
time
.
sleep
(
1
)
# To save the list of new model failures
blocks
=
self
.
get_new_model_failure_blocks
(
to_truncate
=
False
)
failure_text
=
blocks
[
-
1
][
"text"
][
"text"
]
file_path
=
os
.
path
.
join
(
os
.
getcwd
(),
f
"ci_results_
{
job_name
}
/new_model_failures.txt"
)
with
open
(
file_path
,
"w"
,
encoding
=
"UTF-8"
)
as
fp
:
fp
.
write
(
failure_text
)
def
retrieve_artifact
(
artifact_path
:
str
,
gpu
:
Optional
[
str
]):
def
retrieve_artifact
(
artifact_path
:
str
,
gpu
:
Optional
[
str
]):
if
gpu
not
in
[
None
,
"single"
,
"multi"
]:
if
gpu
not
in
[
None
,
"single"
,
"multi"
]:
...
...
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