Unverified 提交 77415a42 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Update git_describe() for remote dir usage (#2606)

上级 fca16dc4
...@@ -45,9 +45,10 @@ def init_torch_seeds(seed=0): ...@@ -45,9 +45,10 @@ def init_torch_seeds(seed=0):
def git_describe(): def git_describe():
# return human-readable git description, i.e. v5.0-5-g3e25f1e https://git-scm.com/docs/git-describe # return human-readable git description, i.e. v5.0-5-g3e25f1e https://git-scm.com/docs/git-describe
if Path('.git').exists(): s = f'git -C {Path(__file__).resolve().parent} describe --tags --long --always'
return subprocess.check_output('git describe --tags --long --always', shell=True).decode('utf-8')[:-1] try:
else: return subprocess.check_output(s, shell=True).decode()[:-1]
except subprocess.CalledProcessError as e:
return '' return ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论