MCPcopy
hub / github.com/modelscope/ms-swift / get_case_model_info

Function get_case_model_info

tests/test_utils.py:96–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

94
95
96def get_case_model_info():
97 status_code, result = subprocess.getstatusoutput(
98 'grep -rn "damo/" tests/ | grep -v ".pyc" | grep -v "Binary file" | grep -v run.py ')
99 lines = result.split('\n')
100 test_cases = OrderedDict()
101 model_cases = OrderedDict()
102 for line in lines:
103 # "tests/msdatasets/test_ms_dataset.py:92: model_id = 'damo/bert-base-sst2'"
104 line = line.strip()
105 elements = line.split(':')
106 test_file = elements[0]
107 model_pos = line.find('damo')
108 left_quote = line[model_pos - 1]
109 rquote_idx = line.rfind(left_quote)
110 model_name = line[model_pos:rquote_idx]
111 if test_file not in test_cases:
112 test_cases[test_file] = set()
113 model_info = test_cases[test_file]
114 model_info.add(model_name)
115
116 if model_name not in model_cases:
117 model_cases[model_name] = set()
118 case_info = model_cases[model_name]
119 case_info.add(test_file.replace('tests/', '').replace('.py', '').replace('/', '.'))
120
121 return model_cases
122
123
124def compare_arguments_nested(print_content, arg1, arg2, rtol=1.e-3, atol=1.e-8, ignore_unknown_type=True):

Callers 1

statistics_test_resultFunction · 0.90

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected