mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 06:12:50 +08:00
Merge pull request #7247 from hiyouga/hiyouga/commit
[misc] support print commit info Former-commit-id: 0f7ec4f8529a5d7ea2153b881335821038307bb7
This commit is contained in:
commit
847ae972d0
@ -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