feat: normalize tags to lowercase for Windows compatibility, see #637

Convert all tags to lowercase in tag processing logic to prevent case sensitivity issues on Windows filesystems. This ensures consistent tag matching and prevents duplicate tags with different cases from being created.

Changes include:
- TagUpdateService now converts tags to lowercase before comparison
- Utils function converts model tags to lowercase before priority resolution
- Test cases updated to reflect lowercase tag expectations
This commit is contained in:
Will Miao
2025-11-04 12:54:09 +08:00
parent 6c03aa1430
commit 3d6bb432c4
5 changed files with 154 additions and 5 deletions

View File

@@ -205,7 +205,9 @@ def calculate_relative_path_for_model(model_data: Dict, model_type: str = 'lora'
base_model_mappings = settings_manager.get('base_model_path_mappings', {})
mapped_base_model = base_model_mappings.get(base_model, base_model)
first_tag = settings_manager.resolve_priority_tag_for_model(model_tags, model_type)
# Convert all tags to lowercase to avoid case sensitivity issues on Windows
lowercase_tags = [tag.lower() for tag in model_tags if isinstance(tag, str)]
first_tag = settings_manager.resolve_priority_tag_for_model(lowercase_tags, model_type)
if not first_tag:
first_tag = 'no tags' # Default if no tags available