(config)
| 63 | |
| 64 | |
| 65 | def get_default_automodel(config) -> Optional[type]: |
| 66 | import modelscope.utils.hf_util as hf_util |
| 67 | if not hasattr(config, 'auto_map'): |
| 68 | return None |
| 69 | auto_map = config.auto_map |
| 70 | automodel_list = [k for k in auto_map.keys() if k.startswith('AutoModel')] |
| 71 | if len(automodel_list) == 1: |
| 72 | return getattr(hf_util, automodel_list[0]) |
| 73 | if len(automodel_list) > 1 and len( |
| 74 | set([auto_map[k] for k in automodel_list])) == 1: |
| 75 | return getattr(hf_util, automodel_list[0]) |
| 76 | return None |
| 77 | |
| 78 | |
| 79 | def get_hf_automodel_class(model_dir: str, |
no test coverage detected
searching dependent graphs…