mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 22:32:54 +08:00
support commit info
Former-commit-id: af752b1c271739e6614773e6898566240d0c7043
This commit is contained in:
parent
317d0855d2
commit
99b71768a0
@ -74,4 +74,13 @@ def print_env() -> None:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
commit_info = subprocess.run(["git", "rev-parse", "HEAD"], capture_output=True, text=True, check=True)
|
||||||
|
commit_hash = commit_info.stdout.strip()
|
||||||
|
info["Git commit"] = commit_hash
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
print("\n" + "\n".join([f"- {key}: {value}" for key, value in info.items()]) + "\n")
|
print("\n" + "\n".join([f"- {key}: {value}" for key, value in info.items()]) + "\n")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user