".github/git@developer.sourcefind.cn:dadigang/Ventoy.git" did not exist on "0f90149c4e3557137f084bd9de42e86b02b9a73b"
Unverified Commit 2255c2c7 authored by Stas Bekman's avatar Stas Bekman Committed by GitHub
Browse files

[seq2seq] get_git_info fails gracefully (#7843)


Co-authored-by: default avatarSam Shleifer <sshleifer@gmail.com>
parent dfa4c26b
...@@ -457,6 +457,7 @@ def load_json(path): ...@@ -457,6 +457,7 @@ def load_json(path):
def get_git_info(): def get_git_info():
try:
repo = git.Repo(search_parent_directories=True) repo = git.Repo(search_parent_directories=True)
repo_infos = { repo_infos = {
"repo_id": str(repo), "repo_id": str(repo),
...@@ -465,6 +466,13 @@ def get_git_info(): ...@@ -465,6 +466,13 @@ def get_git_info():
"hostname": str(socket.gethostname()), "hostname": str(socket.gethostname()),
} }
return repo_infos return repo_infos
except TypeError:
return {
"repo_id": None,
"repo_sha": None,
"repo_branch": None,
"hostname": None,
}
ROUGE_KEYS = ["rouge1", "rouge2", "rougeL", "rougeLsum"] ROUGE_KEYS = ["rouge1", "rouge2", "rougeL", "rougeLsum"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment