Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,15 +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 |
|
| 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,
|
| 21 |
|
| 22 |
#sampling_rate = model.config.sample_rate
|
| 23 |
sampling_rate = 24000
|
|
|
|
| 9 |
|
| 10 |
|
| 11 |
def run_bark(text, lang="en", n=1):
|
| 12 |
+
#history_prompt = []
|
| 13 |
+
semantic_prompt=(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, semantic_prompt=semantic_prompt, do_sample=True)
|
| 21 |
|
| 22 |
#sampling_rate = model.config.sample_rate
|
| 23 |
sampling_rate = 24000
|