Spaces:
Running
Running
michellelychan
commited on
Commit
•
aa1b2f5
1
Parent(s):
e6d2446
set up
Browse files
app.py
CHANGED
@@ -4,7 +4,6 @@ import torch
|
|
4 |
from scipy.io.wavfile import write as write_wav
|
5 |
import os
|
6 |
|
7 |
-
|
8 |
### if you run on GPU use the following code: ####
|
9 |
# device = "cuda" if torch.cuda.is_available() else "cpu"
|
10 |
# model = BarkModel.from_pretrained("suno/bark-small", torch_dtype=torch.float16).to(device)
|
@@ -18,6 +17,7 @@ processor = AutoProcessor.from_pretrained("suno/bark")
|
|
18 |
|
19 |
voice_preset = "v2/en_speaker_3"
|
20 |
|
|
|
21 |
def generate_audio(text, preset, output_file_name="bark_generation"):
|
22 |
file_name = output_file_name + ".wav"
|
23 |
inputs = processor(text, voice_preset=preset)
|
|
|
4 |
from scipy.io.wavfile import write as write_wav
|
5 |
import os
|
6 |
|
|
|
7 |
### if you run on GPU use the following code: ####
|
8 |
# device = "cuda" if torch.cuda.is_available() else "cpu"
|
9 |
# model = BarkModel.from_pretrained("suno/bark-small", torch_dtype=torch.float16).to(device)
|
|
|
17 |
|
18 |
voice_preset = "v2/en_speaker_3"
|
19 |
|
20 |
+
# generate audio
|
21 |
def generate_audio(text, preset, output_file_name="bark_generation"):
|
22 |
file_name = output_file_name + ".wav"
|
23 |
inputs = processor(text, voice_preset=preset)
|