glenn-jocher
commited on
Commit
•
77415a4
1
Parent(s):
fca16dc
Update git_describe() for remote dir usage (#2606)
Browse files- utils/torch_utils.py +4 -3
utils/torch_utils.py
CHANGED
@@ -45,9 +45,10 @@ def init_torch_seeds(seed=0):
|
|
45 |
|
46 |
def git_describe():
|
47 |
# return human-readable git description, i.e. v5.0-5-g3e25f1e https://git-scm.com/docs/git-describe
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
51 |
return ''
|
52 |
|
53 |
|
|
|
45 |
|
46 |
def git_describe():
|
47 |
# return human-readable git description, i.e. v5.0-5-g3e25f1e https://git-scm.com/docs/git-describe
|
48 |
+
s = f'git -C {Path(__file__).resolve().parent} describe --tags --long --always'
|
49 |
+
try:
|
50 |
+
return subprocess.check_output(s, shell=True).decode()[:-1]
|
51 |
+
except subprocess.CalledProcessError as e:
|
52 |
return ''
|
53 |
|
54 |
|