-
Notifications
You must be signed in to change notification settings - Fork 8.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
754 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,37 @@ | ||
import argparse | ||
import os | ||
from pathlib import Path | ||
|
||
from toolbox import Toolbox | ||
from utils.argutils import print_args | ||
from utils.modelutils import check_model_paths | ||
import argparse | ||
import os | ||
from utils.default_models import ensure_default_models | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser( | ||
description="Runs the toolbox", | ||
description="Runs the toolbox.", | ||
formatter_class=argparse.ArgumentDefaultsHelpFormatter | ||
) | ||
|
||
parser.add_argument("-d", "--datasets_root", type=Path, help= \ | ||
"Path to the directory containing your datasets. See toolbox/__init__.py for a list of " | ||
"supported datasets.", default=None) | ||
parser.add_argument("-e", "--enc_models_dir", type=Path, default="encoder/saved_models", | ||
help="Directory containing saved encoder models") | ||
parser.add_argument("-s", "--syn_models_dir", type=Path, default="synthesizer/saved_models", | ||
help="Directory containing saved synthesizer models") | ||
parser.add_argument("-v", "--voc_models_dir", type=Path, default="vocoder/saved_models", | ||
help="Directory containing saved vocoder models") | ||
parser.add_argument("-m", "--models_dir", type=Path, default="saved_models", | ||
help="Directory containing all saved models") | ||
parser.add_argument("--cpu", action="store_true", help=\ | ||
"If True, processing is done on CPU, even when a GPU is available.") | ||
"If True, all inference will be done on CPU") | ||
parser.add_argument("--seed", type=int, default=None, help=\ | ||
"Optional random number seed value to make toolbox deterministic.") | ||
parser.add_argument("--no_mp3_support", action="store_true", help=\ | ||
"If True, no mp3 files are allowed.") | ||
args = parser.parse_args() | ||
arg_dict = vars(args) | ||
print_args(args, parser) | ||
|
||
if args.cpu: | ||
# Hide GPUs from Pytorch to force CPU processing | ||
# Hide GPUs from Pytorch to force CPU processing | ||
if arg_dict.pop("cpu"): | ||
os.environ["CUDA_VISIBLE_DEVICES"] = "-1" | ||
del args.cpu | ||
|
||
## Remind the user to download pretrained models if needed | ||
check_model_paths(encoder_path=args.enc_models_dir, synthesizer_path=args.syn_models_dir, | ||
vocoder_path=args.voc_models_dir) | ||
# Remind the user to download pretrained models if needed | ||
ensure_default_models(args.models_dir) | ||
|
||
# Launch the toolbox | ||
Toolbox(**vars(args)) | ||
Toolbox(**arg_dict) |
Oops, something went wrong.
1 comment
on commit 370e970
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi love your work
ok