fix model_name

This commit is contained in:
Vladimir Mandic
2023-04-23 07:19:51 -04:00
parent 4cb46d5400
commit bef352c233
2 changed files with 3 additions and 2 deletions
+1 -2
View File
@@ -318,10 +318,9 @@ max_filename_part_length = 128
def sanitize_filename_part(text, replace_spaces=True):
if text is None:
return None
text = os.path.basename(text)
if replace_spaces:
text = text.replace(' ', '_')
text = text.translate({ord(x): '_' for x in invalid_filename_chars})
text = text.lstrip(invalid_filename_prefix)[:max_filename_part_length]
text = text.rstrip(invalid_filename_postfix)
+2
View File
@@ -131,6 +131,8 @@ def git(arg: str, folder: str = None, ignore: bool = False):
# update switch to main branch as head can get detached and update repository
def update(folder):
if not os.path.exists(os.path.join(folder, '.git')):
return
branch = git('branch', folder)
if 'main' in branch:
git('checkout main', folder)