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
fbf5089c
Unverified
Commit
fbf5089c
authored
Oct 13, 2023
by
Leymore
Committed by
GitHub
Oct 13, 2023
Browse files
[Sync] update github token (#475)
parent
362c33df
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
opencompass/utils/__init__.py
opencompass/utils/__init__.py
+0
-1
opencompass/utils/abbr.py
opencompass/utils/abbr.py
+4
-2
requirements/runtime.txt
requirements/runtime.txt
+1
-0
run.py
run.py
+8
-3
No files found.
opencompass/utils/__init__.py
View file @
fbf5089c
...
@@ -8,5 +8,4 @@ from .lark import * # noqa
...
@@ -8,5 +8,4 @@ from .lark import * # noqa
from
.logging
import
*
# noqa
from
.logging
import
*
# noqa
from
.menu
import
*
# noqa
from
.menu
import
*
# noqa
from
.prompt
import
*
# noqa
from
.prompt
import
*
# noqa
from
.summarizer
import
*
# noqa
from
.text_postprocessors
import
*
# noqa
from
.text_postprocessors
import
*
# noqa
opencompass/utils/abbr.py
View file @
fbf5089c
import
os.path
as
osp
import
os.path
as
osp
from
typing
import
Dict
from
typing
import
Dict
,
List
,
Union
from
mmengine.config
import
ConfigDict
from
mmengine.config
import
ConfigDict
def
model_abbr_from_cfg
(
cfg
:
ConfigDict
)
->
str
:
def
model_abbr_from_cfg
(
cfg
:
Union
[
ConfigDict
,
List
[
ConfigDict
]]
)
->
str
:
"""Generate model abbreviation from the model's confg."""
"""Generate model abbreviation from the model's confg."""
if
isinstance
(
cfg
,
(
list
,
tuple
)):
return
'_'
.
join
(
model_abbr_from_cfg
(
c
)
for
c
in
cfg
)
if
'abbr'
in
cfg
:
if
'abbr'
in
cfg
:
return
cfg
[
'abbr'
]
return
cfg
[
'abbr'
]
model_abbr
=
cfg
[
'type'
]
+
'_'
+
'_'
.
join
(
model_abbr
=
cfg
[
'type'
]
+
'_'
+
'_'
.
join
(
...
...
requirements/runtime.txt
View file @
fbf5089c
...
@@ -21,6 +21,7 @@ rouge
...
@@ -21,6 +21,7 @@ rouge
rouge_chinese
rouge_chinese
rouge_score
rouge_score
scikit_learn==1.2.1
scikit_learn==1.2.1
seaborn
sentence_transformers==2.2.2
sentence_transformers==2.2.2
tabulate
tabulate
tiktoken
tiktoken
...
...
run.py
View file @
fbf5089c
...
@@ -7,9 +7,10 @@ from datetime import datetime
...
@@ -7,9 +7,10 @@ from datetime import datetime
from
mmengine.config
import
Config
,
DictAction
from
mmengine.config
import
Config
,
DictAction
from
opencompass.partitioners
import
MultimodalNaivePartitioner
from
opencompass.partitioners
import
MultimodalNaivePartitioner
from
opencompass.registry
import
PARTITIONERS
,
RUNNERS
from
opencompass.registry
import
PARTITIONERS
,
RUNNERS
,
build_from_cfg
from
opencompass.runners
import
SlurmRunner
from
opencompass.runners
import
SlurmRunner
from
opencompass.utils
import
LarkReporter
,
Summarizer
,
get_logger
from
opencompass.summarizers
import
DefaultSummarizer
from
opencompass.utils
import
LarkReporter
,
get_logger
from
opencompass.utils.run
import
(
exec_mm_infer_runner
,
fill_eval_cfg
,
from
opencompass.utils.run
import
(
exec_mm_infer_runner
,
fill_eval_cfg
,
fill_infer_cfg
,
get_config_from_arg
)
fill_infer_cfg
,
get_config_from_arg
)
...
@@ -315,7 +316,11 @@ def main():
...
@@ -315,7 +316,11 @@ def main():
# visualize
# visualize
if
args
.
mode
in
[
'all'
,
'eval'
,
'viz'
]:
if
args
.
mode
in
[
'all'
,
'eval'
,
'viz'
]:
summarizer
=
Summarizer
(
cfg
)
summarizer_cfg
=
cfg
.
get
(
'summarizer'
,
{})
if
not
summarizer_cfg
or
summarizer_cfg
.
get
(
'type'
,
None
)
is
None
:
summarizer_cfg
[
'type'
]
=
DefaultSummarizer
summarizer_cfg
[
'config'
]
=
cfg
summarizer
=
build_from_cfg
(
summarizer_cfg
)
summarizer
.
summarize
(
time_str
=
cfg_time_str
)
summarizer
.
summarize
(
time_str
=
cfg_time_str
)
...
...
Prev
1
2
Next
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