Skip to content

Commit

Permalink
Add hack to fix error when metadata.txt has tab indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Sep 13, 2024
1 parent 7f3f12b commit 5d114e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions customizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def get_model_metadata(custom_model_name):
if old_format_match and not new_format_match:
metadata_str = re.sub(r"^( +\S[^:]*: +)\"?([0-9A-F]{6})\"?$", r"\g<1>0x\g<2>", metadata_str, flags = re.IGNORECASE | re.MULTILINE)

# Hack to remove tab indentation because it's not valid YAML.
metadata_str = re.sub(r"\t", r" ", metadata_str, flags = re.IGNORECASE | re.MULTILINE)

metadata = yaml.load(metadata_str)
except Exception as e:
error_message = str(e)
Expand Down

0 comments on commit 5d114e4

Please sign in to comment.