def _search_for_model(names, workdir):
"""
Check if a model file is available.
:param names: list of model names to be searcher for, highest ranking
first
:type names: str
:param workdir: the workdir where the model file is located
:type name: str
:type workdir: str
:returns: the path to the model file or None if model file not found
"""
for name in names:
path = os.path.join(workdir, name)
if os.access(path, os.F_OK):
return path
return None
评论列表
文章目录