Merge pull request #491 from willmiao/codex/replace-spaces-in-embedding-paths

Fix embedding relative paths by replacing spaces
This commit is contained in:
pixelpaws
2025-09-26 09:06:56 +08:00
committed by GitHub
4 changed files with 55 additions and 1 deletions

View File

@@ -245,3 +245,17 @@ async def test_download_rejects_unsupported_model_type(monkeypatch, scanners):
assert result["success"] is False
assert result["error"].startswith("Model type")
def test_embedding_relative_path_replaces_spaces():
manager = DownloadManager()
version_info = {
"baseModel": "Base Model",
"model": {"tags": ["tag with space"]},
"creator": {"username": "Author Name"},
}
relative_path = manager._calculate_relative_path(version_info, "embedding")
assert relative_path == "Base_Model/tag_with_space"