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
9058be07
Unverified
Commit
9058be07
authored
Aug 25, 2023
by
Tong Gao
Committed by
GitHub
Aug 25, 2023
Browse files
[Feature] Simplify entry script (#204)
* [Feature] Simply entry script * update
parent
f480b727
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
tools/list_configs.py
tools/list_configs.py
+33
-0
No files found.
tools/list_configs.py
0 → 100644
View file @
9058be07
import
argparse
import
tabulate
from
opencompass.utils
import
match_files
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
description
=
'Utils to list available models and datasets.'
)
parser
.
add_argument
(
'pattern'
,
nargs
=
'*'
,
default
=
'*'
,
type
=
str
,
help
=
'Patterns, '
'wildcard matching supported.'
)
return
parser
.
parse_args
()
def
main
():
args
=
parse_args
()
models
=
match_files
(
'configs/models/'
,
args
.
pattern
,
fuzzy
=
True
)
if
models
:
table
=
[[
'Model'
,
'Config Path'
],
*
models
]
print
(
tabulate
.
tabulate
(
table
,
headers
=
'firstrow'
,
tablefmt
=
'psql'
))
datasets
=
match_files
(
'configs/datasets/'
,
args
.
pattern
,
fuzzy
=
True
)
if
datasets
:
table
=
[[
'Dataset'
,
'Config Path'
],
*
datasets
]
print
(
tabulate
.
tabulate
(
table
,
headers
=
'firstrow'
,
tablefmt
=
'psql'
))
if
__name__
==
'__main__'
:
main
()
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