diff --git a/voicevox_engine/downloadable_library.py b/voicevox_engine/downloadable_library.py index 7c1222469..0b17ffe86 100644 --- a/voicevox_engine/downloadable_library.py +++ b/voicevox_engine/downloadable_library.py @@ -172,7 +172,6 @@ def install_library(self, library_id: str, file: BytesIO): temp_dir = TemporaryDirectory() temp_dir_path = Path(temp_dir.name) library_dir = self.library_root_dir / library_id - library_dir.mkdir(exist_ok=True) # with open(library_dir / INFO_FILE, "w", encoding="utf-8") as f: # json.dump(library_info, f, indent=4, ensure_ascii=False) if not zipfile.is_zipfile(file): @@ -241,7 +240,9 @@ def install_library(self, library_id: str, file: BytesIO): models = list( set( map( - lambda p: str(p).split("/")[-2], temp_dir_path.glob("**/*.onnx") + # Windows向けにバックスラッシュの置き換え処理を入れる + lambda p: str(p).replace("\\", "/").split("/")[-2], + temp_dir_path.glob("**/*.onnx") ) ) ) @@ -267,6 +268,8 @@ def install_library(self, library_id: str, file: BytesIO): "models": models, } ) + + library_dir.mkdir(exist_ok=True) with open( library_dir / "library.json", "w",