fix: Normalize path separators in relative path handling for improved compatibility across platforms

This commit is contained in:
Will Miao
2025-08-21 11:52:46 +08:00
parent 6c5559ae2d
commit fdec535559
3 changed files with 7 additions and 6 deletions

View File

@@ -167,6 +167,7 @@ class LoraService(BaseModelService):
if file_path:
# Convert to forward slashes and extract relative path
file_path_normalized = file_path.replace('\\', '/')
relative_path = relative_path.replace('\\', '/')
# Find the relative path part by looking for the relative_path in the full path
if file_path_normalized.endswith(relative_path) or relative_path in file_path_normalized:
return lora.get('usage_tips', '')