Skip to content

Commit

Permalink
Use natsort for better data packing
Browse files Browse the repository at this point in the history
  • Loading branch information
leng-yue committed Dec 29, 2023
1 parent 982f787 commit 74ec1db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fish_speech/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Union

from loguru import logger
from natsort import natsorted

AUDIO_EXTENSIONS = {
".mp3",
Expand Down Expand Up @@ -49,7 +50,7 @@ def list_files(
files = [f for f in files if f.suffix in extensions]

if sort:
files = sorted(files)
files = natsorted(files)

return files

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ dependencies = [
"zibai-server>=0.9.0",
"loguru>=0.6.0",
"WeTextProcessing>=0.1.10",
"loralib>=0.1.2"
"loralib>=0.1.2",
"natsort>=8.4.0"
]

[project.optional-dependencies]
Expand Down

0 comments on commit 74ec1db

Please sign in to comment.