Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,10 @@ device = "cpu"
|
|
13 |
|
14 |
processor = AutoProcessor.from_pretrained("suno/bark-small")
|
15 |
model = BarkModel.from_pretrained("suno/bark-small").to(device)
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
def run_bark(text, n, lang="en"):
|
20 |
#history_prompt = []
|
21 |
semantic_prompt=f"v2/{lang}_speaker_{int(n)}"
|
22 |
|
@@ -37,12 +37,16 @@ def run_bark(text, n, lang="en"):
|
|
37 |
with gr.Blocks() as app:
|
38 |
with gr.Column():
|
39 |
in_text = gr.Textbox()
|
40 |
-
|
|
|
|
|
|
|
|
|
41 |
go_btn = gr.Button()
|
42 |
|
43 |
with gr.Column():
|
44 |
out_audio = gr.Audio()
|
45 |
|
46 |
-
go_btn.click(run_bark,[in_text, speaker_num],out_audio)
|
47 |
|
48 |
app.launch()
|
|
|
13 |
|
14 |
processor = AutoProcessor.from_pretrained("suno/bark-small")
|
15 |
model = BarkModel.from_pretrained("suno/bark-small").to(device)
|
16 |
+
num_list = ["1","2","3","4","5","6","7","8","9","10"]
|
17 |
+
lang_list = ["en","fr"]
|
18 |
|
19 |
+
def run_bark(text, n, lang):
|
|
|
|
|
20 |
#history_prompt = []
|
21 |
semantic_prompt=f"v2/{lang}_speaker_{int(n)}"
|
22 |
|
|
|
37 |
with gr.Blocks() as app:
|
38 |
with gr.Column():
|
39 |
in_text = gr.Textbox()
|
40 |
+
with gr.Row():
|
41 |
+
speaker_num = gr.Dropdown(label="Language in Image:", choices=num_list),value="1")
|
42 |
+
speaker_lang = gr.Dropdown(label="Language in Image:", choices=num_list),value="1")
|
43 |
+
|
44 |
+
#speaker_num = gr.Number(value=0)
|
45 |
go_btn = gr.Button()
|
46 |
|
47 |
with gr.Column():
|
48 |
out_audio = gr.Audio()
|
49 |
|
50 |
+
go_btn.click(run_bark,[in_text, speaker_num, speaker_lang],out_audio)
|
51 |
|
52 |
app.launch()
|