Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -639,12 +639,6 @@ def convert_ebook_to_audio(ebook_file, target_voice_file, language, use_custom_m
|
|
639 |
# If the language argument is set use it instead
|
640 |
language = args.language if args.language else language
|
641 |
|
642 |
-
if use_custom_model and custom_model_file and custom_config_file and custom_vocab_file:
|
643 |
-
custom_model = {
|
644 |
-
'model': custom_model_file.name,
|
645 |
-
'config': custom_config_file.name,
|
646 |
-
'vocab': custom_vocab_file.name
|
647 |
-
}
|
648 |
# If headless is used with the custom model arguments
|
649 |
if args.use_custom_model and args.custom_model and args.custom_config and args.custom_vocab:
|
650 |
custom_model = {
|
@@ -652,6 +646,13 @@ def convert_ebook_to_audio(ebook_file, target_voice_file, language, use_custom_m
|
|
652 |
'config': args.custom_config,
|
653 |
'vocab': args.custom_vocab
|
654 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
655 |
if (use_custom_model and custom_model_url) or (args.use_custom_model and custom_model_url):
|
656 |
print(f"Received custom model URL: {custom_model_url}")
|
657 |
download_dir = os.path.join(".", "Working_files", "custom_model")
|
|
|
639 |
# If the language argument is set use it instead
|
640 |
language = args.language if args.language else language
|
641 |
|
|
|
|
|
|
|
|
|
|
|
|
|
642 |
# If headless is used with the custom model arguments
|
643 |
if args.use_custom_model and args.custom_model and args.custom_config and args.custom_vocab:
|
644 |
custom_model = {
|
|
|
646 |
'config': args.custom_config,
|
647 |
'vocab': args.custom_vocab
|
648 |
}
|
649 |
+
|
650 |
+
elif use_custom_model and custom_model_file and custom_config_file and custom_vocab_file:
|
651 |
+
custom_model = {
|
652 |
+
'model': custom_model_file.name,
|
653 |
+
'config': custom_config_file.name,
|
654 |
+
'vocab': custom_vocab_file.name
|
655 |
+
}
|
656 |
if (use_custom_model and custom_model_url) or (args.use_custom_model and custom_model_url):
|
657 |
print(f"Received custom model URL: {custom_model_url}")
|
658 |
download_dir = os.path.join(".", "Working_files", "custom_model")
|