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
OpenDAS
opencompass
Commits
986a44ce
"vscode:/vscode.git/clone" did not exist on "0617528632fe266427e1ee6cf5037e3fca06e538"
Unverified
Commit
986a44ce
authored
Jul 05, 2023
by
Tong Gao
Committed by
GitHub
Jul 05, 2023
Browse files
Tranlate lark messages (#5)
parent
719ba34d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
opencompass/runners/base.py
opencompass/runners/base.py
+14
-12
No files found.
opencompass/runners/base.py
View file @
986a44ce
...
...
@@ -2,7 +2,7 @@ import getpass
from
abc
import
abstractmethod
from
typing
import
Any
,
Dict
,
List
,
Tuple
from
mmengine.config
import
Config
Dict
,
Config
from
mmengine.config
import
Config
,
Config
Dict
from
opencompass.utils
import
LarkReporter
,
get_logger
...
...
@@ -65,16 +65,18 @@ class BaseRunner:
if
self
.
lark_reporter
:
num_succeeded
=
len
(
status
)
-
len
(
failed_logs
)
if
len
(
failed_logs
)
>
0
:
content
=
f
'
{
getpass
.
getuser
()
}
的
'
content
+=
f
'
{
self
.
task_cfg
.
type
}
任务已完成,
'
content
+=
f
'
成功任务
{
num_succeeded
}
个,
'
content
+=
f
'
失败
{
len
(
failed_logs
)
}
个。以下为失败的任务列表:
'
content
+=
'
\n
'
+
'
\n
'
.
join
(
failed_logs
)
self
.
lark_reporter
.
post
(
title
=
f
'
悲报:您有
{
len
(
failed_logs
)
}
个
'
'
任务炸了
'
,
content
=
f
'
{
getpass
.
getuser
()
}
\'
s
'
content
+=
f
'
{
self
.
task_cfg
.
type
}
tasks finished.
'
content
+=
f
'
{
num_succeeded
}
tasks succeeded,
'
content
+=
f
'
{
len
(
failed_logs
)
}
tasks failed. Failed tasks are
'
content
+=
'
:
\n
'
+
'
\n
'
.
join
(
failed_logs
)
self
.
lark_reporter
.
post
(
title
=
f
'
Bad news:
{
len
(
failed_logs
)
}
'
'
failed.
'
,
content
=
content
)
else
:
content
=
f
'
{
getpass
.
getuser
()
}
的 '
content
+=
f
'
{
self
.
task_cfg
.
type
}
任务已完成,'
content
+=
f
'成功任务
{
num_succeeded
}
个。'
self
.
lark_reporter
.
post
(
title
=
'喜报:全部任务完成'
,
content
=
content
)
content
=
f
'
{
getpass
.
getuser
()
}
\'
s '
content
+=
f
'
{
self
.
task_cfg
.
type
}
tasks finished. '
content
+=
f
'
{
num_succeeded
}
tasks succeeded.'
self
.
lark_reporter
.
post
(
title
=
'Great news: all tasks '
'finished!'
,
content
=
content
)
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