mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
fix model_name
This commit is contained in:
+1
-2
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user