Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
4980832
1
Parent(s):
3278943
updated app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def preprocess_audio(waveform):
|
|
| 28 |
# processed_waveform_np = rms_normalize(peak_normalize(waveform_np))
|
| 29 |
return torch.from_numpy(waveform_np).unsqueeze(0).to(device)
|
| 30 |
|
| 31 |
-
|
| 32 |
def generate_drum_sample():
|
| 33 |
model = MusicGen.get_pretrained('pharoAIsanders420/micro-musicgen-jungle')
|
| 34 |
model.set_generation_params(duration=10)
|
|
@@ -41,7 +41,7 @@ def generate_drum_sample():
|
|
| 41 |
|
| 42 |
return filename_with_extension
|
| 43 |
|
| 44 |
-
|
| 45 |
def continue_drum_sample(existing_audio_path):
|
| 46 |
# Load the existing audio
|
| 47 |
existing_audio, sr = torchaudio.load(existing_audio_path)
|
|
@@ -85,7 +85,7 @@ def continue_drum_sample(existing_audio_path):
|
|
| 85 |
|
| 86 |
return combined_file_path
|
| 87 |
|
| 88 |
-
@spaces.GPU(90)
|
| 89 |
def generate_music(wav_filename, prompt_duration, musicgen_model, output_duration):
|
| 90 |
# Load the audio from the passed file path
|
| 91 |
song, sr = torchaudio.load(wav_filename)
|
|
@@ -121,7 +121,7 @@ def generate_music(wav_filename, prompt_duration, musicgen_model, output_duratio
|
|
| 121 |
|
| 122 |
return filename_with_extension
|
| 123 |
|
| 124 |
-
@spaces.GPU(90)
|
| 125 |
def continue_music(input_audio_path, prompt_duration, musicgen_model, output_duration):
|
| 126 |
# Load the audio from the given file path
|
| 127 |
song, sr = torchaudio.load(input_audio_path)
|
|
|
|
| 28 |
# processed_waveform_np = rms_normalize(peak_normalize(waveform_np))
|
| 29 |
return torch.from_numpy(waveform_np).unsqueeze(0).to(device)
|
| 30 |
|
| 31 |
+
@spaces.GPU(duration=10)
|
| 32 |
def generate_drum_sample():
|
| 33 |
model = MusicGen.get_pretrained('pharoAIsanders420/micro-musicgen-jungle')
|
| 34 |
model.set_generation_params(duration=10)
|
|
|
|
| 41 |
|
| 42 |
return filename_with_extension
|
| 43 |
|
| 44 |
+
@spaces.GPU(duration=10)
|
| 45 |
def continue_drum_sample(existing_audio_path):
|
| 46 |
# Load the existing audio
|
| 47 |
existing_audio, sr = torchaudio.load(existing_audio_path)
|
|
|
|
| 85 |
|
| 86 |
return combined_file_path
|
| 87 |
|
| 88 |
+
@spaces.GPU(duation=90)
|
| 89 |
def generate_music(wav_filename, prompt_duration, musicgen_model, output_duration):
|
| 90 |
# Load the audio from the passed file path
|
| 91 |
song, sr = torchaudio.load(wav_filename)
|
|
|
|
| 121 |
|
| 122 |
return filename_with_extension
|
| 123 |
|
| 124 |
+
@spaces.GPU(duration=90)
|
| 125 |
def continue_music(input_audio_path, prompt_duration, musicgen_model, output_duration):
|
| 126 |
# Load the audio from the given file path
|
| 127 |
song, sr = torchaudio.load(input_audio_path)
|