Skip to content

Commit

Permalink
fix library install bug
Browse files Browse the repository at this point in the history
  • Loading branch information
y-chan committed Aug 10, 2023
1 parent 1f2a5c3 commit 7d47274
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions voicevox_engine/downloadable_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ def install_library(self, library_id: str, file: BytesIO):
shutil.move(temp_dir_path / model, self.model_dir)
all_speaker_info = (temp_dir_path / "speaker_info").rglob("*")
for info in all_speaker_info:
if (temp_dir_path / info).is_dir():
# temp dirのパスの`speaker_info`以前を置き換える
info = Path(str(info).replace(str(temp_dir_path / "speaker_info") + "/", ""))
if (temp_dir_path / "speaker_info" / info).is_dir():
os.makedirs(self.speaker_info_dir / info, exist_ok=True)
else:
shutil.move(temp_dir_path / info, self.library_root_dir / info)
shutil.move(temp_dir_path / "speaker_info" / info, self.speaker_info_dir / info)
vvlib_manifest.update(
{
"models": models,
Expand Down

0 comments on commit 7d47274

Please sign in to comment.