drewThomasson commited on
Commit
478fd32
1 Parent(s): d4f10c0

Update Headless_VoxNovel.py

Browse files
Files changed (1) hide show
  1. Headless_VoxNovel.py +15 -3
Headless_VoxNovel.py CHANGED
@@ -424,6 +424,7 @@ import sys
424
  def process_file_headless():
425
  # Ask for the file path via command line
426
  while True:
 
427
  #file_path = input("Enter the file path of the ebook: ")
428
  gradio_input_file = sys.argv[1]
429
  file_path = gradio_input_file
@@ -924,7 +925,8 @@ def check_and_wipe_folder(directory_path):
924
  ## Ask the user if they want to delete the files
925
  #response = messagebox.askyesno("Confirm Deletion", "Audio clips from a previous session have been found. Do you want to wipe them?")
926
  #root.destroy() # Destroy the tkinter instance
927
- response = input("Audio clips from a previous session have been found. Do you want to wipe them? (yes/no): ").strip().lower()
 
928
  #auto set it to wipe the folder
929
  print("Auto-wiping... setting to yes")
930
  response = 'yes'
@@ -1165,6 +1167,7 @@ def select_voices():
1165
 
1166
  # Get user input for which speaker to change
1167
  try:
 
1168
  selection = int(input("Enter the number of the speaker to change the voice for: ")) - 1
1169
  if selection < 0 or selection >= len(speaker_voice_map):
1170
  raise ValueError("Selection out of range.")
@@ -1185,6 +1188,7 @@ def select_voices():
1185
  for idx, voice in enumerate(available_voices, start=1):
1186
  print(f"{idx}. {voice}")
1187
  try:
 
1188
  new_voice_selection = int(input("Select the new voice by number: ")) - 1
1189
  if new_voice_selection < 0 or new_voice_selection >= len(available_voices):
1190
  raise ValueError("Selection out of range.")
@@ -1705,6 +1709,7 @@ def select_tts_model():
1705
  print(model)
1706
 
1707
  while True:
 
1708
  selected_model = input("Please type the name of one of the above models: ").strip()
1709
  if selected_model in all_models:
1710
  current_model = selected_model
@@ -1725,7 +1730,10 @@ from tkinter import filedialog
1725
 
1726
  def clone_new_voice():
1727
  while True:
1728
- confirm = input("Do you want to clone a new voice? (y/n): ").lower()
 
 
 
1729
  if confirm == 'y':
1730
  voice_actor_name = input("Enter the name of the new voice actor: ")
1731
  voice_actor_gender = input("Enter the gender of the new voice actor (M/F/?): ")
@@ -1755,7 +1763,10 @@ def clone_new_voice():
1755
 
1756
  def add_fine_tuned_model():
1757
  while True:
1758
- confirm = input("Do you want to add a fine-tuned XTTS model to a voice actor? (y/n): ").lower()
 
 
 
1759
  if confirm == 'y':
1760
  base_directory = "tortoise/voices/"
1761
  folders = [folder for folder in os.listdir(base_directory) if os.path.isdir(os.path.join(base_directory, folder))]
@@ -1836,6 +1847,7 @@ def select_language_terminal():
1836
  # User selects the language
1837
  while True:
1838
  try:
 
1839
  choice = int(input("Select a language by number: "))
1840
  language = languages[choice - 1]
1841
  break
 
424
  def process_file_headless():
425
  # Ask for the file path via command line
426
  while True:
427
+ print("Auto-setting VoxNovel input ebook file to gradio input...")
428
  #file_path = input("Enter the file path of the ebook: ")
429
  gradio_input_file = sys.argv[1]
430
  file_path = gradio_input_file
 
925
  ## Ask the user if they want to delete the files
926
  #response = messagebox.askyesno("Confirm Deletion", "Audio clips from a previous session have been found. Do you want to wipe them?")
927
  #root.destroy() # Destroy the tkinter instance
928
+ print("Audio clips from a previous session have been found. Do you want to wipe them? (yes/no): ")
929
+ #response = input("Audio clips from a previous session have been found. Do you want to wipe them? (yes/no): ").strip().lower()
930
  #auto set it to wipe the folder
931
  print("Auto-wiping... setting to yes")
932
  response = 'yes'
 
1167
 
1168
  # Get user input for which speaker to change
1169
  try:
1170
+ print("Enter the number of the speaker to change the voice for: ")
1171
  selection = int(input("Enter the number of the speaker to change the voice for: ")) - 1
1172
  if selection < 0 or selection >= len(speaker_voice_map):
1173
  raise ValueError("Selection out of range.")
 
1188
  for idx, voice in enumerate(available_voices, start=1):
1189
  print(f"{idx}. {voice}")
1190
  try:
1191
+ print("Select the new voice by number: ")
1192
  new_voice_selection = int(input("Select the new voice by number: ")) - 1
1193
  if new_voice_selection < 0 or new_voice_selection >= len(available_voices):
1194
  raise ValueError("Selection out of range.")
 
1709
  print(model)
1710
 
1711
  while True:
1712
+ print("Please type the name of one of the above models: ")
1713
  selected_model = input("Please type the name of one of the above models: ").strip()
1714
  if selected_model in all_models:
1715
  current_model = selected_model
 
1730
 
1731
  def clone_new_voice():
1732
  while True:
1733
+ print("Do you want to clone a new voice? (y/n): ")
1734
+ #confirm = input("Do you want to clone a new voice? (y/n): ").lower()
1735
+ print("Auto-Skipping clone voice selection... setting answer to n")
1736
+ confirm = 'n'
1737
  if confirm == 'y':
1738
  voice_actor_name = input("Enter the name of the new voice actor: ")
1739
  voice_actor_gender = input("Enter the gender of the new voice actor (M/F/?): ")
 
1763
 
1764
  def add_fine_tuned_model():
1765
  while True:
1766
+ print("Do you want to add a fine-tuned XTTS model to a voice actor? (y/n): ")
1767
+ #confirm = input("Do you want to add a fine-tuned XTTS model to a voice actor? (y/n): ").lower()
1768
+ print("Auto-Skipping add fine-tuned XTTS model... auto setting anwer to n")
1769
+ confirm = 'n'
1770
  if confirm == 'y':
1771
  base_directory = "tortoise/voices/"
1772
  folders = [folder for folder in os.listdir(base_directory) if os.path.isdir(os.path.join(base_directory, folder))]
 
1847
  # User selects the language
1848
  while True:
1849
  try:
1850
+ print("Select a language by number: ")
1851
  choice = int(input("Select a language by number: "))
1852
  language = languages[choice - 1]
1853
  break