From e57903f6f604756ef3a890538aaac7a81fe0edd7 Mon Sep 17 00:00:00 2001 From: Enno Hermann Date: Wed, 26 Jun 2024 16:08:51 +0200 Subject: [PATCH] fix(generic_utils): apply get_git_branch fix from coqui-tts Same fix as https://github.com/coqui-ai/TTS/pull/3561 --- trainer/generic_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trainer/generic_utils.py b/trainer/generic_utils.py index 05bf2d1..3243a52 100644 --- a/trainer/generic_utils.py +++ b/trainer/generic_utils.py @@ -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