mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-10-14 23:58:11 +08:00
support commit info
Former-commit-id: a7d89a6dc10579deaf9f45825cc18405a27cade6
This commit is contained in:
parent
522a3e8493
commit
d019603835
@ -74,4 +74,13 @@ def print_env() -> None:
|
||||
except Exception:
|
||||
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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user