Spaces:
Runtime error
Runtime error
j
commited on
Commit
·
9e1944e
1
Parent(s):
17cceff
get rid of unneeded save_wave func
Browse files
app.py
CHANGED
@@ -6,24 +6,6 @@ import soundfile as sf
|
|
6 |
|
7 |
audioldm = build_model(model_name="audioldm-m-full")
|
8 |
|
9 |
-
def save_wave(waveform, savepath, name="outwav"):
|
10 |
-
if type(name) is not list:
|
11 |
-
name = [name] * waveform.shape[0]
|
12 |
-
|
13 |
-
for i in range(waveform.shape[0]):
|
14 |
-
path = os.path.join(
|
15 |
-
savepath,
|
16 |
-
"%s_%s.wav"
|
17 |
-
% (
|
18 |
-
os.path.basename(name[i])
|
19 |
-
if (not ".wav" in name[i])
|
20 |
-
else os.path.basename(name[i]).split(".")[0],
|
21 |
-
i,
|
22 |
-
),
|
23 |
-
)
|
24 |
-
print("Save audio to %s" % path)
|
25 |
-
sf.write(path, waveform[i, 0], samplerate=16000)
|
26 |
-
|
27 |
def process_fn(input_audio_path, prompt, seed, guidance_scale, num_inference_steps, num_candidates, audio_length_in_s, transfer_strength):
|
28 |
waveform = style_transfer(
|
29 |
audioldm,
|
|
|
6 |
|
7 |
audioldm = build_model(model_name="audioldm-m-full")
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
def process_fn(input_audio_path, prompt, seed, guidance_scale, num_inference_steps, num_candidates, audio_length_in_s, transfer_strength):
|
10 |
waveform = style_transfer(
|
11 |
audioldm,
|