File size: 988 Bytes
256a159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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()