Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -9,14 +9,15 @@ model = AutoModel.from_pretrained("suno/bark-small")
|
|
9 |
|
10 |
|
11 |
def run_bark(text, lang="en", n=1):
|
12 |
-
history_prompt=
|
|
|
13 |
|
14 |
#text=["Hello, my name is Suno. And, uh β and I like pizza. [laughs] But I also have other interests such as playing tic tac toe."],
|
15 |
inputs = processor(text=text,
|
16 |
return_tensors="pt",
|
17 |
)
|
18 |
|
19 |
-
speech_values = model.generate(**inputs, history_prompt=
|
20 |
|
21 |
#sampling_rate = model.config.sample_rate
|
22 |
sampling_rate = 24000
|
|
|
9 |
|
10 |
|
11 |
def run_bark(text, lang="en", n=1):
|
12 |
+
history_prompt = []
|
13 |
+
history_prompt.append(f"v2/{lang}_speaker_{n}")
|
14 |
|
15 |
#text=["Hello, my name is Suno. And, uh β and I like pizza. [laughs] But I also have other interests such as playing tic tac toe."],
|
16 |
inputs = processor(text=text,
|
17 |
return_tensors="pt",
|
18 |
)
|
19 |
|
20 |
+
speech_values = model.generate(**inputs, history_prompt=history_prompt[0], do_sample=True)
|
21 |
|
22 |
#sampling_rate = model.config.sample_rate
|
23 |
sampling_rate = 24000
|