(model_root_path: str, )
| 15 | |
| 16 | |
| 17 | def get_model_id_from_cache(model_root_path: str, ) -> str: |
| 18 | model_cache = None |
| 19 | # download with git |
| 20 | if os.path.exists(os.path.join(model_root_path, '.git')): |
| 21 | git_cmd_wrapper = GitCommandWrapper() |
| 22 | git_url = git_cmd_wrapper.get_repo_remote_url(model_root_path) |
| 23 | if git_url.endswith('.git'): |
| 24 | git_url = git_url[:-4] |
| 25 | u_parse = urlparse(git_url) |
| 26 | model_id = u_parse.path[1:] |
| 27 | else: # snapshot_download |
| 28 | model_cache = ModelFileSystemCache(model_root_path) |
| 29 | model_id = model_cache.get_model_id() |
| 30 | return model_id |
| 31 | |
| 32 | |
| 33 | def check_local_model_is_latest( |
no test coverage detected
searching dependent graphs…