Skip to content

Commit

Permalink
Add continue as semantic history button to Bark (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsxdalv authored Sep 21, 2023
1 parent 7104993 commit c741db4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ https://rsxdalv.github.io/bark-speaker-directory/

## Changelog
Sep 21:
* Bark: Add continue as semantic history button
* Switch to github docker image storage, new docker image:
* `docker pull ghcr.io/rsxdalv/tts-generation-webui:latest`
* `docker pull ghcr.io/rsxdalv/tts-generation-webui:main`
* Fix server_port option in config https://github.com/rsxdalv/tts-generation-webui/issues/168 , thanks to https://github.com/Dartvauder

Sep 9:
Expand Down
4 changes: 3 additions & 1 deletion src/bark/BarkModelManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ def reload_models(self, config):
)

def unload_models(self):
print("Unloading Bark models")
print("Unloading Bark models...")
self.models_loaded = False
clean_models()
print("Unloaded Bark models")

def unload_model(self, model_key):
print(f"Unloading Bark model {model_key}")
clean_models(model_key=model_key)
print(f"Unloaded Bark model {model_key}")
23 changes: 21 additions & 2 deletions src/bark/generation_tab_bark.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,11 @@ def update_max_length(value):
zip(
*[
create_components(
old_generation_dropdown, history_setting, index, seed_input
old_generation_dropdown,
history_prompt_semantic_dropdown,
history_setting,
index,
seed_input,
)
for index in range(MAX_OUTPUTS)
]
Expand Down Expand Up @@ -813,7 +817,13 @@ def insert_npz_file(npz_filename):
]


def create_components(old_generation_dropdown, history_setting, index, seed_input):
def create_components(
old_generation_dropdown,
history_prompt_semantic_dropdown,
history_setting,
index,
seed_input,
):
with gr.Column(visible=index == 0) as col:
audio = gr.Audio(
type="filepath", label="Generated audio", elem_classes="tts-audio"
Expand Down Expand Up @@ -851,6 +861,7 @@ def create_components(old_generation_dropdown, history_setting, index, seed_inpu
)
send_to_vocos_button = gr.Button("Vocos", size="sm")
continue_button = gr.Button("Use as history", size="sm")
continue_semantic_button = gr.Button("Use as semantic history", size="sm")
npz = gr.State() # type: ignore
seed = gr.State() # type: ignore
json_text = gr.State() # type: ignore
Expand Down Expand Up @@ -884,6 +895,14 @@ def create_components(old_generation_dropdown, history_setting, index, seed_inpu
outputs=[old_generation_dropdown, history_setting],
)

continue_semantic_button.click(
fn=insert_npz_file,
inputs=[npz],
outputs=[history_prompt_semantic_dropdown, history_setting],
)

# fix the bug where selecting No history does not work with burn in prompt

return (
[
audio,
Expand Down

0 comments on commit c741db4

Please sign in to comment.