Skip to content

Commit

Permalink
Bugfix: Installer not cloning/pulling repo
Browse files Browse the repository at this point in the history
Bugfix: Clone Voice missing tokenizer selection
Installer always does a hard reset to ignore local changes
  • Loading branch information
C0untFloyd committed Jun 12, 2023
1 parent c63a6a0 commit 96593c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions cloning/clonevoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import gradio


def clone_voice(audio_filepath, dest_filename, progress=gradio.Progress(track_tqdm=True)):
def clone_voice(audio_filepath, tokenizer_lang, dest_filename, progress=gradio.Progress(track_tqdm=True)):
# if len(text) < 1:
# raise gradio.Error('No transcription text entered!')

Expand All @@ -21,7 +21,7 @@ def clone_voice(audio_filepath, dest_filename, progress=gradio.Progress(track_tq
# From https://github.com/gitmylo/bark-voice-cloning-HuBERT-quantizer
hubert_manager = HuBERTManager()
hubert_manager.make_sure_hubert_installed()
hubert_manager.make_sure_tokenizer_installed()
hubert_manager.make_sure_tokenizer_installed(tokenizer_lang=tokenizer_lang)

# From https://github.com/gitmylo/bark-voice-cloning-HuBERT-quantizer
# Load HuBERT for semantic tokens
Expand All @@ -31,7 +31,7 @@ def clone_voice(audio_filepath, dest_filename, progress=gradio.Progress(track_tq
hubert_model = CustomHubert(checkpoint_path='./models/hubert/hubert.pt').to(device)

# Load the CustomTokenizer model
tokenizer = CustomTokenizer.load_from_checkpoint('./models/hubert/tokenizer.pth').to(device) # Automatically uses the right layers
tokenizer = CustomTokenizer.load_from_checkpoint(f'./models/hubert/{tokenizer_lang}_tokenizer.pth').to(device) # Automatically uses the right layers

progress(0.25, desc="Converting WAV")

Expand Down
7 changes: 5 additions & 2 deletions installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def check_env():
def install_dependencies():
# Install Git and clone repo
run_cmd("conda install -y -k git")
#run_cmd("git clone https://github.com/C0untFloyd/bark-gui.git")
run_cmd("git clone https://github.com/C0untFloyd/bark-gui.git")

# Select your GPU or, choose to run in CPU mode
print("Do you have a GPU (Nvidia)?")
Expand All @@ -47,7 +47,10 @@ def install_dependencies():

def update_dependencies():
os.chdir("bark-gui")
#run_cmd("git pull")
# do a hard reset for to update even if there are local changes
run_cmd("git fetch --all")
run_cmd("git reset --hard origin/main")
run_cmd("git pull")
# Installs/Updates dependencies from all requirements.txt
run_cmd("python -m pip install .")
run_cmd("python -m pip install -r requirements.txt")
Expand Down
4 changes: 2 additions & 2 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def create_version_html():


logger = logging.getLogger(__name__)
APPTITLE = "Bark UI Enhanced v0.7"
APPTITLE = "Bark UI Enhanced v0.7.1"


autolaunch = False
Expand Down Expand Up @@ -443,7 +443,7 @@ def create_version_html():
hidden_checkbox.change(delete_output_files, [hidden_checkbox], [hidden_checkbox])

swap_voice_button.click(swap_voice_from_audio, inputs=[swap_audio_filename, speaker_swap, swap_tokenizer_lang, swap_seed, swap_batchcount], outputs=output_swap)
clone_voice_button.click(clone_voice, inputs=[input_audio_filename, output_voice], outputs=dummy)
clone_voice_button.click(clone_voice, inputs=[input_audio_filename, tokenizerlang, output_voice], outputs=dummy)
training_prepare_button.click(training_prepare, inputs=[prepare_dropdown, prepare_semantics_number], outputs=dummytrd)
train_button.click(start_training, inputs=[save_model_epoch, max_epochs], outputs=dummytrain)
button_apply_settings.click(apply_settings, inputs=[themes, input_server_name, input_server_port, share_checkbox, input_desired_len, input_max_len, input_silence_break, input_silence_speakers])
Expand Down

0 comments on commit 96593c0

Please sign in to comment.