Upload 3 files
Browse files- README.md +1 -2
- app.py +7 -8
- requirements.txt +10 -4
README.md
CHANGED
|
@@ -4,8 +4,7 @@ emoji: 🐶
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
-
python_version: 3.8.15
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
license: cc-by-nc-4.0
|
|
|
|
| 4 |
colorFrom: gray
|
| 5 |
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 5.42.0
|
|
|
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: cc-by-nc-4.0
|
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import numpy as np
|
| 2 |
import gradio as gr
|
| 3 |
from bark import SAMPLE_RATE, generate_audio, preload_models
|
|
@@ -117,6 +118,7 @@ examples = [
|
|
| 117 |
]
|
| 118 |
|
| 119 |
|
|
|
|
| 120 |
def gen_tts(text, history_prompt): # , temp_semantic, temp_waveform):
|
| 121 |
history_prompt = PROMPT_LOOKUP[history_prompt]
|
| 122 |
if DEBUG_MODE:
|
|
@@ -169,11 +171,9 @@ with gr.Blocks(css=css) as block:
|
|
| 169 |
gr.Markdown(description)
|
| 170 |
with gr.Row():
|
| 171 |
with gr.Column():
|
| 172 |
-
input_text = gr.Textbox(
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
AVAILABLE_PROMPTS, value="Speaker 1 (en)", label="Acoustic Prompt", elem_id="speaker_option")
|
| 176 |
-
run_button = gr.Button(text="Generate Audio", type="button")
|
| 177 |
with gr.Column():
|
| 178 |
audio_out = gr.Audio(label="Generated Audio",
|
| 179 |
type="numpy", elem_id="audio_out")
|
|
@@ -181,9 +181,8 @@ with gr.Blocks(css=css) as block:
|
|
| 181 |
with gr.Group(elem_id="share-btn-container"):
|
| 182 |
community_icon = gr.HTML(community_icon_html)
|
| 183 |
loading_icon = gr.HTML(loading_icon_html)
|
| 184 |
-
share_button = gr.Button(
|
| 185 |
-
|
| 186 |
-
share_button.click(None, [], [], _js=share_js)
|
| 187 |
inputs = [input_text, options]
|
| 188 |
outputs = [audio_out]
|
| 189 |
gr.Examples(examples=examples, fn=gen_tts, inputs=inputs,
|
|
|
|
| 1 |
+
import spaces
|
| 2 |
import numpy as np
|
| 3 |
import gradio as gr
|
| 4 |
from bark import SAMPLE_RATE, generate_audio, preload_models
|
|
|
|
| 118 |
]
|
| 119 |
|
| 120 |
|
| 121 |
+
@spaces.GPU(duration=59)
|
| 122 |
def gen_tts(text, history_prompt): # , temp_semantic, temp_waveform):
|
| 123 |
history_prompt = PROMPT_LOOKUP[history_prompt]
|
| 124 |
if DEBUG_MODE:
|
|
|
|
| 171 |
gr.Markdown(description)
|
| 172 |
with gr.Row():
|
| 173 |
with gr.Column():
|
| 174 |
+
input_text = gr.Textbox(label="Input Text", lines=2, value=default_text, elem_id="input_text")
|
| 175 |
+
options = gr.Dropdown(AVAILABLE_PROMPTS, value="Speaker 1 (en)", label="Acoustic Prompt", elem_id="speaker_option")
|
| 176 |
+
run_button = gr.Button("Generate Audio")
|
|
|
|
|
|
|
| 177 |
with gr.Column():
|
| 178 |
audio_out = gr.Audio(label="Generated Audio",
|
| 179 |
type="numpy", elem_id="audio_out")
|
|
|
|
| 181 |
with gr.Group(elem_id="share-btn-container"):
|
| 182 |
community_icon = gr.HTML(community_icon_html)
|
| 183 |
loading_icon = gr.HTML(loading_icon_html)
|
| 184 |
+
share_button = gr.Button("Share to community", elem_id="share-btn")
|
| 185 |
+
share_button.click(None, [], [], js=share_js)
|
|
|
|
| 186 |
inputs = [input_text, options]
|
| 187 |
outputs = [audio_out]
|
| 188 |
gr.Examples(examples=examples, fn=gen_tts, inputs=inputs,
|
requirements.txt
CHANGED
|
@@ -1,5 +1,11 @@
|
|
| 1 |
git+https://github.com/suno-ai/bark.git
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
git+https://github.com/suno-ai/bark.git
|
| 2 |
+
torch==2.1.0
|
| 3 |
+
torchvision
|
| 4 |
+
torchaudio
|
| 5 |
+
triton
|
| 6 |
+
numpy<2
|
| 7 |
+
#https://download.pytorch.org/whl/nightly/pytorch_triton-2.1.0%2B46672772b4-cp38-cp38-linux_x86_64.whl
|
| 8 |
+
#https://download.pytorch.org/whl/nightly/cu117/torch-2.1.0.dev20230413%2Bcu117-cp38-cp38-linux_x86_64.whl
|
| 9 |
+
#https://download.pytorch.org/whl/nightly/cu117/torchvision-0.16.0.dev20230413%2Bcu117-cp38-cp38-linux_x86_64.whl
|
| 10 |
+
#https://download.pytorch.org/whl/nightly/cu117/torchaudio-2.1.0.dev20230413%2Bcu117-cp38-cp38-linux_x86_64.whl
|
| 11 |
+
pydantic==2.10.6
|