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

Function get_cache_mapping

scripts/utils/run_model_info.py:18–33  ·  view source on GitHub ↗
(fpath)

Source from the content-addressed store, hash-verified

16
17
18def get_cache_mapping(fpath):
19 with open(fpath, 'r', encoding='utf-8') as f:
20 text = f.read()
21 idx = text.find('| Model ID |')
22 end_idx = text.find('| Dataset ID |')
23 text = text[idx:end_idx]
24 text_list = text.split('\n')[2:]
25 cache_mapping = {}
26 for text in text_list:
27 if not text:
28 continue
29 items = text.split('|')
30 if len(items) < 6:
31 continue
32 cache_mapping[items[1]] = items[5]
33 return cache_mapping
34
35
36def get_model_info_table():

Callers 1

get_model_info_tableFunction · 0.70

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected