(fpath)
| 16 | |
| 17 | |
| 18 | def 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 | |
| 36 | def get_model_info_table(): |
no test coverage detected