Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add audiogen #105

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TTS Generation WebUI (Bark, MusicGen, Tortoise, RVC, Vocos, Demucs)
# TTS Generation WebUI (Bark, MusicGen + AudioGen, Tortoise, RVC, Vocos, Demucs)

## One click installers

Expand Down Expand Up @@ -34,6 +34,9 @@ Google Colab demo: [![Open In Colab](https://colab.research.google.com/assets/co
https://rsxdalv.github.io/bark-speaker-directory/

## Changelog
Aug 3:
* Add AudioGen https://github.com/rsxdalv/tts-generation-webui/pull/105

Aug 2:
* Fix Model locations not showing after restart

Expand Down Expand Up @@ -260,3 +263,4 @@ Most notably:
- Bark: CC BY-NC 4.0 (MIT According to repo, but CC BY-NC 4.0 according to HuggingFace)
- Tortoise: *Unknown* (Apache-2.0 according to repo, but no license file in HuggingFace)
- MusicGen: CC BY-NC 4.0
- AudioGen: CC BY-NC 4.0
2 changes: 1 addition & 1 deletion requirements_audiocraft.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# audiocraft==0.0.1 # MIT License
audiocraft @ git+https://git@github.com/facebookresearch/audiocraft@d874966#egg=audiocraft # MIT License
audiocraft @ git+https://git@github.com/facebookresearch/audiocraft@c5157b5bf14bf83449c17ea1eeb66c19fb4bc7f0#egg=audiocraft # MIT License
8 changes: 5 additions & 3 deletions src/musicgen/musicgen_tab.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import torch
import gradio as gr
from audiocraft.models.musicgen import MusicGen
from audiocraft.models.audiogen import AudioGen
from typing import Optional, Tuple, TypedDict
import numpy as np
import os
Expand Down Expand Up @@ -112,6 +113,8 @@ def save_generation(


def load_model(version):
if version == "facebook/audiogen-medium":
return AudioGen.get_pretrained(version)
print("Loading model", version)
return MusicGen.get_pretrained(version)

Expand Down Expand Up @@ -197,9 +200,8 @@ def generate(params: MusicGenGeneration, melody_in: Optional[Tuple[int, np.ndarr
]



def generation_tab_musicgen():
with gr.Tab("MusicGen") as tab:
with gr.Tab("MusicGen + AudioGen") as tab:
musicgen_atom = gr.JSON(
# visible=True,
visible=False,
Expand All @@ -223,7 +225,7 @@ def generation_tab_musicgen():
label="Prompt", lines=3, placeholder="Enter text here..."
)
model = gr.Radio(
["melody", "medium", "small", "large"],
["melody", "medium", "small", "large", "facebook/audiogen-medium"],
label="Model",
value="melody",
)
Expand Down