Skip to content

Commit

Permalink
fix(generic_utils): apply get_git_branch fix from coqui-tts
Browse files Browse the repository at this point in the history
Same fix as coqui-ai/TTS#3561
  • Loading branch information
eginhard committed Jun 26, 2024
1 parent bfeee49 commit e57903f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trainer/generic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ def get_cuda():
return use_cuda, device


def get_git_branch():
def get_git_branch() -> str:
try:
out = subprocess.check_output(["git", "branch"]).decode("utf8")
current = next(line for line in out.split("\n") if line.startswith("*"))
current.replace("* ", "")
except subprocess.CalledProcessError:
current = "inside_docker"
except FileNotFoundError:
except (FileNotFoundError, StopIteration):
current = "unknown"
return current

Expand Down

0 comments on commit e57903f

Please sign in to comment.