Omnibus commited on
Commit
f4e63b7
β€’
1 Parent(s): 23828ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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
- 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
 
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