Skip to content

Commit 11b5ddf

Browse files
committed
Handle detached HEAD
1 parent fc73da4 commit 11b5ddf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

vllm-benchmarks/upload_benchmark_results.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ def parse_args() -> Any:
7171

7272
def get_git_metadata(vllm_dir: str) -> Tuple[str, str]:
7373
repo = Repo(vllm_dir)
74-
return repo.active_branch.name, repo.head.object.hexsha
74+
try:
75+
return repo.active_branch.name, repo.head.object.hexsha
76+
except TypeError:
77+
# This is a detached HEAD, default the branch to main
78+
return "main", repo.head.object.hexsha
7579

7680

7781
def get_benchmark_metadata(head_branch: str, head_sha: str) -> Dict[str, Any]:

0 commit comments

Comments
 (0)